Tokenizes code with the template grammar, takes the resulting tokens out, tokenizes
everything that is left as one whole with the host grammar, and then puts the template
tokens back where they were.
This is how templating languages (e.g. Liquid in HTML) and other meta-languages
(e.g. a diff of CSS) embed an inner language. Grammars use it declaratively via $inner.
By default, each template token leaves an identifier-like placeholder behind, so that the
host grammar still sees a value where the token was (e.g. an attribute value). Template
grammars whose tokens don’t stand for anything (e.g. the line prefixes of a diff) set
$placeholder: false to have them removed without a trace instead.
Template tokens whose type starts with ignore are not taken out; their text is passed to
the host grammar as-is.
Tokenizes
codewith the template grammar, takes the resulting tokens out, tokenizes everything that is left as one whole with the host grammar, and then puts the template tokens back where they were.This is how templating languages (e.g. Liquid in HTML) and other meta-languages (e.g. a diff of CSS) embed an inner language. Grammars use it declaratively via
$inner.By default, each template token leaves an identifier-like placeholder behind, so that the host grammar still sees a value where the token was (e.g. an attribute value). Template grammars whose tokens don’t stand for anything (e.g. the line prefixes of a diff) set
$placeholder: falseto have them removed without a trace instead.Template tokens whose type starts with
ignoreare not taken out; their text is passed to the host grammar as-is.