dyaml.token

YAML tokens. Code based on PyYAML: http://www.pyyaml.org

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)
Methods
int opCmp(ref Token) @disable
string idString() @property @safe pure constGet string representation of the token ID.
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

fnToken directiveToken(const Mark start, const Mark end, char[] value, DirectiveType directive, const uint nameEnd) @safe pure nothrow @nogcConstruct a directive token.
fnToken simpleToken(TokenID id)(const Mark start, const Mark end)Construct a simple (no value) token with specified type.
fnToken streamStartToken(const Mark start, const Mark end, const Encoding encoding) @safe pure nothrow @nogcConstruct a stream start token.
fnToken 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.
fnToken scalarToken(const Mark start, const Mark end, char[] value, const ScalarStyle style) @safe pure nothrow @nogcConstruct a scalar token.