Skip to content

Instantly share code, notes, and snippets.

@rogpeppe
Created January 2, 2018 17:41
Show Gist options
  • Save rogpeppe/9e1604a44abc33b44994bdd680983126 to your computer and use it in GitHub Desktop.
Save rogpeppe/9e1604a44abc33b44994bdd680983126 to your computer and use it in GitHub Desktop.

SEQ (Stream start)

Syntax:

str: "+STR+"

This event represents the start of a YAML stream. A stream contains zero or more DOC nodes.

+STR

+DOC (Document start)

Syntax:

doc = "+DOC" "---"?

This event represents the start of a YAML document within a stream.

The optional --- argument specifies whether the document has explicit separators or not.

=VAL (Explicit value)

Syntax:

val = "=VAL" (" &" anchor)? (" <" tag)? " " quote str
anchor = name
tag = name
name = [^ ]+
quote = [:'">|]
str = .*

This event represents an explicit value. The anchor argument specifies the name of a possible alias reference (see ALI); the tag argument specifies the value's tag. The quote character represents the style of quoting that that was used to represent the value; if this is a colon, the value was presented unquoted. Within str, \n represents a newline character (ascii 10) and \t represents a tab (ascii 8).

Examples:

=VAL :99
=VAL &ref "some value\n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment