Documentation ¶
Index ¶
- Constants
- func As_digit(b []byte, i int) int
- func As_hex(b []byte, i int) int
- func IsBlank(b byte) bool
- func IsBlankz(b []byte) bool
- func IsBreak(b []byte) bool
- func IsPrintable(b []byte) bool
- func Is_alpha(b []byte, i int) bool
- func Is_blank(b []byte, i int) bool
- func Is_blankz(b []byte, i int) bool
- func Is_bom(b []byte) bool
- func Is_break(b []byte, i int) bool
- func Is_breakz(b []byte, i int) bool
- func Is_crlf(b []byte, i int) bool
- func Is_digit(b []byte, i int) bool
- func Is_hex(b []byte, i int) bool
- func Is_space(b []byte, i int) bool
- func Is_spacez(b []byte, i int) bool
- func Is_tab(b []byte, i int) bool
- func Is_z(b []byte, i int) bool
- func Width(b byte) int
- type Break
- type Encoding
- type ErrorType
- type Event
- type EventType
- type Position
- type SimpleKey
- type TagDirective
- type TokenType
- type VersionDirective
- type YamlComment
- type YamlMappingStyle
- type YamlScalarStyle
- type YamlSequenceStyle
- type YamlStyle
- type YamlToken
Constants ¶
View Source
const ( // The size of the input raw buffer. Input_raw_buffer_size = 512 // The size of the input buffer. // It should be possible to decode the whole raw buffer. Input_buffer_size = Input_raw_buffer_size * 3 // The size of other stacks and queues. Initial_stack_size = 16 Initial_queue_size = 16 )
View Source
const ( NULL_TAG = "tag:yaml.org,2002:null" // The tag !!null with the only possible value: null. BOOL_TAG = "tag:yaml.org,2002:bool" // The tag !!bool with the values: true and false. STR_TAG = "tag:yaml.org,2002:str" // The tag !!str for string values. INT_TAG = "tag:yaml.org,2002:int" // The tag !!int for integer values. FLOAT_TAG = "tag:yaml.org,2002:float" // The tag !!float for float values. TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp" // The tag !!timestamp for date and time values. SEQ_TAG = "tag:yaml.org,2002:seq" // The tag !!seq is used to denote sequences. MAP_TAG = "tag:yaml.org,2002:map" // The tag !!map is used to denote mapping. // Not in original libyaml. BINARY_TAG = "tag:yaml.org,2002:binary" MERGE_TAG = "tag:yaml.org,2002:merge" DEFAULT_SCALAR_TAG = STR_TAG // The default scalar tag is !!str. DEFAULT_SEQUENCE_TAG = SEQ_TAG // The default sequence tag is !!seq. DEFAULT_MAPPING_TAG = MAP_TAG // The default mapping tag is !!map. )
Variables ¶
This section is empty.
Functions ¶
func IsPrintable ¶
Check if the character at the start of the buffer can be printed unescaped.
func Is_alpha ¶
Check if the character at the specified position is an alphabetical character, a digit, '_', or '-'.
Types ¶
type ErrorType ¶
type ErrorType int
const ( // No error is produced. NO_ERROR ErrorType = iota READER_ERROR // Cannot read or decode the input stream. SCANNER_ERROR // Cannot scan the input stream. PARSER_ERROR // Cannot parsePanic the input stream. WRITER_ERROR // Cannot write to the output stream. EMITTER_ERROR // Cannot emit a YAML stream. )
Many bad things could happen with the parser and emitter.
type Event ¶
type Event struct { // The event type. Type EventType // The start and end of the event. Start_mark, End_mark Position // The document Encoding (for STREAM_START_EVENT). Encoding Encoding // The version directive (for DOCUMENT_START_EVENT). Version_directive *VersionDirective // The list of tag directives (for DOCUMENT_START_EVENT). Tag_directives []TagDirective // The comments Head_comment []byte Line_comment []byte Foot_comment []byte Tail_comment []byte // The Anchor (for SCALAR_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT, ALIAS_EVENT). Anchor []byte // The Tag (for SCALAR_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT). Tag []byte // The scalar Value (for SCALAR_EVENT). Value []byte // Is the document start/end indicator Implicit, or the Tag optional? // (for DOCUMENT_START_EVENT, DOCUMENT_END_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT, SCALAR_EVENT). Implicit bool // Is the Tag optional for any non-plain style? (for SCALAR_EVENT). Quoted_implicit bool // The Style (for SCALAR_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT). Style YamlStyle }
The Event structure.
func (*Event) Mapping_style ¶
func (e *Event) Mapping_style() YamlMappingStyle
func (*Event) Scalar_style ¶
func (e *Event) Scalar_style() YamlScalarStyle
func (*Event) Sequence_style ¶
func (e *Event) Sequence_style() YamlSequenceStyle
type EventType ¶
type EventType int8
const ( NO_EVENT EventType = iota STREAM_START_EVENT // A STREAM-START event. STREAM_END_EVENT // A STREAM-END event. DOCUMENT_START_EVENT // A DOCUMENT-START event. DOCUMENT_END_EVENT // A DOCUMENT-END event. ALIAS_EVENT // An ALIAS event. SCALAR_EVENT // A SCALAR event. SEQUENCE_START_EVENT // A SEQUENCE-START event. SEQUENCE_END_EVENT // A SEQUENCE-END event. MAPPING_START_EVENT // A MAPPING-START event. MAPPING_END_EVENT // A MAPPING-END event. TAIL_COMMENT_EVENT )
Event types.
type Position ¶
type Position struct { Index int // The position Index. Line int // The position Line. Column int // The position Column. }
Position is he pointer position.
type SimpleKey ¶
type SimpleKey struct { Possible bool // Is a simple key Possible? Required bool // Is a simple key Required? Token_number int // The number of the token. Mark Position // The position Mark. }
SimpleKey holds information about a potential simple key.
type TagDirective ¶
type TokenType ¶
type TokenType int
const ( // An empty token. NO_TOKEN TokenType = iota STREAM_START_TOKEN // A STREAM-START token. STREAM_END_TOKEN // A STREAM-END token. VERSION_DIRECTIVE_TOKEN // A VERSION-DIRECTIVE token. TAG_DIRECTIVE_TOKEN // A TAG-DIRECTIVE token. DOCUMENT_START_TOKEN // A DOCUMENT-START token. DOCUMENT_END_TOKEN // A DOCUMENT-END token. BLOCK_SEQUENCE_START_TOKEN // A BLOCK-SEQUENCE-START token. BLOCK_MAPPING_START_TOKEN // A BLOCK-SEQUENCE-END token. BLOCK_END_TOKEN // A BLOCK-END token. FLOW_SEQUENCE_START_TOKEN // A FLOW-SEQUENCE-START token. FLOW_SEQUENCE_END_TOKEN // A FLOW-SEQUENCE-END token. FLOW_MAPPING_START_TOKEN // A FLOW-MAPPING-START token. FLOW_MAPPING_END_TOKEN // A FLOW-MAPPING-END token. BLOCK_ENTRY_TOKEN // A BLOCK-ENTRY token. FLOW_ENTRY_TOKEN // A FLOW-ENTRY token. KEY_TOKEN // A KEY token. VALUE_TOKEN // A VALUE token. ALIAS_TOKEN // An ALIAS token. ANCHOR_TOKEN // An ANCHOR token. TAG_TOKEN // A TAG token. SCALAR_TOKEN // A SCALAR token. )
Token types.
type VersionDirective ¶
type YamlComment ¶
type YamlComment struct { Scan_mark Position // Position where scanning for comments started Token_mark Position // Position after which tokens will be associated with this comment Start_mark Position // Position of '#' comment mark End_mark Position // Position where comment terminated Head []byte Line []byte Foot []byte }
type YamlMappingStyle ¶
type YamlMappingStyle YamlStyle
const ( // Let the emitter choose the style. ANY_MAPPING_STYLE YamlMappingStyle = iota BLOCK_MAPPING_STYLE // The block mapping style. FLOW_MAPPING_STYLE // The flow mapping style. )
Mapping styles.
type YamlScalarStyle ¶
type YamlScalarStyle YamlStyle
const ( // Let the emitter choose the style. ANY_SCALAR_STYLE YamlScalarStyle = 0 PLAIN_SCALAR_STYLE YamlScalarStyle = 1 << iota // The plain scalar style. SINGLE_QUOTED_SCALAR_STYLE // The single-quoted scalar style. DOUBLE_QUOTED_SCALAR_STYLE // The double-quoted scalar style. LITERAL_SCALAR_STYLE // The literal scalar style. FOLDED_SCALAR_STYLE // The folded scalar style. )
Scalar styles.
type YamlSequenceStyle ¶
type YamlSequenceStyle YamlStyle
const ( // Let the emitter choose the style. ANY_SEQUENCE_STYLE YamlSequenceStyle = iota BLOCK_SEQUENCE_STYLE // The block sequence style. FLOW_SEQUENCE_STYLE // The flow sequence style. )
Sequence styles.
type YamlToken ¶
type YamlToken struct { // The token type. Type TokenType // The start/end of the token. Start_mark, End_mark Position // The stream Encoding (for STREAM_START_TOKEN). Encoding Encoding // The alias/anchor/scalar Value or tag/tag directive handle // (for ALIAS_TOKEN, ANCHOR_TOKEN, yaml_SCALAR_TOKEN, yaml_TAG_TOKEN, yaml_TAG_DIRECTIVE_TOKEN). Value []byte // The tag Suffix (for TAG_TOKEN). Suffix []byte // The tag directive Prefix (for TAG_DIRECTIVE_TOKEN). Prefix []byte // The scalar Style (for SCALAR_TOKEN). Style YamlScalarStyle // The version directive Major/minor (for VERSION_DIRECTIVE_TOKEN). Major, Minor int8 }
Click to show internal directories.
Click to hide internal directories.