"EBNF: parse-abc [=["
"abc = <foreign a-token> 'b' 'c'"
"]=]"
- }
-}
-;
+ }
+} ;
ARTICLE: "peg.ebnf.tokenizers" "EBNF Tokenizers"
"It is possible to override the tokenizer in an EBNF defined parser. "
{ $code "USING: vocabs.parser binary-search ;" "... search ..." }
"Because " { $link POSTPONE: FROM: } " takes precedence over a " { $link POSTPONE: USING: } ", the ambiguity can be resolved explicitly. Suppose you wanted the " { $vocab-link "binary-search" } " vocabulary's " { $snippet "search" } " word:"
{ $code "USING: vocabs.parser binary-search ;" "FROM: binary-search => search ;" "... search ..." }
- } ;
+} ;
HELP: EXCLUDE:
{ $syntax "EXCLUDE: vocab => words ... ;" }
"\"ABAABA\" \"ABA\" start-all ."
"{ 0 3 }"
}
- } ;
+} ;
HELP: start-all*
{ $values
emitter-width
} ;
-
HELP: emitter-canonical
{ $var-description "If set, " { $link yaml_emitter_set_canonical } " is called with the value of this variable at the beginning of each document." } ;
;
HELP: implicit-tags
-{ $var-description "When this is set, tags are omitted during serialization when it safe to do so. For example, 42 can be safely serialized as \"42\", but \"42\" must be serialized as \"'42'\" or \"\"42\"\" or \"!!str 42\". This uses the "
-{ $snippet "implicit" } " parameter of "
-{ $link yaml_scalar_event_initialize } ", " { $link yaml_sequence_start_event_initialize } " and " { $link yaml_mapping_start_event_initialize } "."
- } ;
+{ $var-description "When this is set, tags are omitted during serialization when it safe to do so. For example, 42 can be safely serialized as \"42\", but \"42\" must be serialized as \"'42'\" or \"\"42\"\" or \"!!str 42\". This uses the " { $snippet "implicit" } " parameter of " { $link yaml_scalar_event_initialize } ", " { $link yaml_sequence_start_event_initialize } " and " { $link yaml_mapping_start_event_initialize } "."
+} ;
HELP: implicit-start
{ $var-description "The \""
- 42.0
- 4.2e1\" yaml> ."
"{ t f \"42\" \"42\" 42 42 42 42.0 42.0 }"
- }
+}
{ $heading "Output -- human readable" }
{ $unchecked-example "USING: yaml yaml.config ;"
"t implicit-tags set
{ emitter-width 32 }
}
[
-{ "- - a string that can be split
+ { "- - a string that can be split
in lots of places
"
- } [ { { "a string that can be split in lots of places" } } >yaml ] unit-test
+ } [ { { "a string that can be split in lots of places" } } >yaml ] unit-test
] with-variables
! line break