dyaml.token
YAML tokens. Code based on PyYAML: http://www.pyyaml.org
alias aliasToken anchorToken blockEndToken blockEntryToken blockMappingStartToken blockSequenceStartToken flowEntryToken keyToken streamEndToken tagToken valueToken
struct Token
Types 14
enumTokenID : ubyte
Token types.
invalid = 0
directive
documentStart
documentEnd
streamStart
streamEnd
blockSequenceStart
blockMappingStart
blockEnd
flowSequenceStart
flowMappingStart
flowSequenceEnd
flowMappingEnd
key
value
blockEntry
flowEntry
alias_
anchor
tag
scalar
enumDirectiveType : ubyte
Specifies the type of a tag directive token.
yaml
tag
reserved
structToken
Token produced by scanner.
32 bytes on 64-bit.
Fields
char[] valueValue of the token, if any.Mark startMarkStart position of the token in file/stream.Mark endMarkEnd position of the token in file/stream.TokenID idToken type.ScalarStyle styleStyle of scalar token, if this is a scalar token.Encoding encodingEncoding, if this is a stream start token.DirectiveType directiveType of directive for directiveToken.uint valueDividerUsed to split value into 2 substrings for tokens that need 2 values (tagToken)aliasstreamEndToken = simpleToken!(TokenID.streamEnd)
Aliases for construction of simple token types.
aliasblockSequenceStartToken = simpleToken!(TokenID.blockSequenceStart)
aliasblockMappingStartToken = simpleToken!(TokenID.blockMappingStart)
aliasblockEndToken = simpleToken!(TokenID.blockEnd)
aliaskeyToken = simpleToken!(TokenID.key)
aliasvalueToken = simpleToken!(TokenID.value)
aliasblockEntryToken = simpleToken!(TokenID.blockEntry)
aliasflowEntryToken = simpleToken!(TokenID.flowEntry)
aliastagToken = simpleValueToken!(TokenID.tag)
Alias for construction of tag token.
aliasaliasToken = simpleValueToken!(TokenID.alias_)
aliasanchorToken = simpleValueToken!(TokenID.anchor)
Functions 5
fn
Token directiveToken(const Mark start, const Mark end, char[] value,
DirectiveType directive, const uint nameEnd) @safe pure nothrow @nogcConstruct a directive token.fn
Token simpleToken(TokenID id)(const Mark start, const Mark end)Construct a simple (no value) token with specified type.fn
Token streamStartToken(const Mark start, const Mark end, const Encoding encoding) @safe pure nothrow @nogcConstruct a stream start token.fn
Token simpleValueToken(TokenID id)(const Mark start, const Mark end, char[] value,
const uint valueDivider = uint.max)Construct a simple token with value with specified type.fn
Token scalarToken(const Mark start, const Mark end, char[] value, const ScalarStyle style) @safe pure nothrow @nogcConstruct a scalar token.