Description
Absolute JSON streams and writer counters use a zero-based unsigned 64-bit coordinate space. This is the reviewed public format boundary; changing its width is source- and diagnostic-contract-incompatible.
Byte_Offset
subtype Byte_Offset is Interfaces.Unsigned_64;
Absolute JSON streams and writer counters use a zero-based unsigned 64-bit coordinate space. This is the reviewed public format boundary; changing its width is source- and diagnostic-contract-incompatible.
Clear
procedure Clear (Item : out Diagnostic)
Clear sets both codes to No_Error, both coordinates to No_Coordinate, and both offsets to zero. A primary offset is eligible only when its coordinate is not No_Coordinate. Secondary coordinate and offset are eligible only when Secondary /= No_Error.
Parameters
- Item
Diagnostic value to replace with the cleared representation.
Coordinate_Kind
type Coordinate_Kind is
(No_Coordinate, Source_Byte, Writer_Token_Byte, Staged_Output_Byte, JSON_Call_Ordinal);
Coordinate system used by a diagnostic offset.
Enumeration literals
- No_Coordinate
The associated offset is ineligible and must not be observed.
- Source_Byte
A zero-based byte offset in the complete parser input stream.
- Writer_Token_Byte
A zero-based byte offset in the active writer token.
- Staged_Output_Byte
A zero-based byte offset in the unpublished destination output.
- JSON_Call_Ordinal
A zero-based ordinal for a semantic writer call.
Diagnostic
type Diagnostic is record
Code : Error_Code;
Coordinate : Coordinate_Kind;
Offset : Byte_Offset;
Secondary : Error_Code;
Secondary_Coordinate : Coordinate_Kind;
Secondary_Offset : Byte_Offset;
end record;
Primary failure and optional cleanup failure retained by an operation.
Record fields
- Code
Primary error code, or
No_Errorwhen the operation succeeded.- Coordinate
Coordinate system for
Offset.- Offset
Primary zero-based position; eligible only when
Coordinateis notNo_Coordinate.- Secondary
Cleanup error code, or
No_Errorwhen cleanup did not add a failure.- Secondary_Coordinate
Coordinate system for
Secondary_Offset.- Secondary_Offset
Cleanup-failure position; eligible only when
Secondaryis notNo_Error.
Error_Code
type Error_Code is
(No_Error,
Unsupported_Profile,
Incompatible_Profile,
Invalid_State,
Final_Input_Retracted,
Invalid_Writer_Grammar,
Writer_Interrupted,
Unexpected_Token,
…,
Abort_Failed);
Machine-readable reason for a failed or rejected parser or writer operation.
Enumeration literals
- No_Error
The operation has no error.
- Unsupported_Profile
A profile family or version is not implemented.
- Incompatible_Profile
The selected profile fields cannot be combined.
- Invalid_State
The operation is not legal in the current lifecycle state.
- Final_Input_Retracted
A later parser call changed latched final input from true to false.
- Invalid_Writer_Grammar
A writer call violates the JSON event grammar.
- Writer_Interrupted
An abnormal transfer interrupted an active writer call.
- Unexpected_Token
An input octet cannot begin or continue the required JSON construct.
- Trailing_Input
A complete root value is followed by a non-whitespace octet.
- Truncated_Input
Final input ended before the current JSON construct completed.
- Invalid_Literal
A
null,true, orfalsespelling is invalid.- Invalid_Number
A numeric lexeme violates strict JSON number syntax.
- Invalid_Escape
A string escape is not one of the JSON escape forms.
- Invalid_UTF8
Input contains an invalid UTF-8 sequence.
- Invalid_Surrogate
A Unicode escape contains an unpaired or misordered surrogate.
- Raw_Control_Character
A string contains an unescaped control character.
- Duplicate_Name
A later object member repeats an earlier decoded member name.
- Top_Level_Kind_Rejected
The selected profile rejects the recognized root value kind.
- Depth_Exhausted
Opening another container would exceed the parser or writer depth.
- Name_Storage_Exhausted
Decoded duplicate-name storage cannot hold the active name.
- Duplicate_Index_Exhausted
The duplicate-name index cannot add another unique name.
- Offset_Exhausted
A zero-based source or writer counter cannot represent the next octet.
- Destination_Exhausted
The writer destination cannot stage all required output.
- Destination_Failed
The writer destination rejected a begin or write operation.
- Commit_Failed
The destination did not publish the completed document.
- Abort_Failed
The destination reported failure while ending unpublished staging.