|Re: [asciidoc-lang-dev] Whitespace handling|
On 09/03/2021 01:20, Lex Trotman wrote:
> Ahh yes another extension I did was that all non-terminals and tokens
> can return a numeric value (if they match) and I added a simple syntax
> for assigning that value if its needed, and comparing it to the
> parameter passed to the non-terminal. Tokens return a count of relevant
> characters that varies from token to token but is effectively the level
> for section/list tokens or length of delimiter for block delimiters.
> The (simplified) syntax for a "section" would be:
> Section(level) ::= token_level = <start_line_equals>
> (:token_level==level:) Markup_text_line Section_contents *Section(level+1)
> where <line_start_equals> is the token from the lexer, (:_expression_:) is
> a test that will fail the non-terminal if it fails, and name= assigns
> the value to name. These have the obvious implementation in code.
Yes, that's a problem for a PEG-based _implementation_. For the specs, I
suppose we can add such guard clauses without causing too much harm.
asciidoc-lang-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
Back to the top