Previously the action had to be a factor word and could only appear at the end of a rule: : aword ( ast -- ast ) drop V{ 1 2 } ; <EBNF foo = "a" "b" => aword EBNF> Now actions can appear anywhere after an element, and can be any factor code between [[ ... ]] delimiters: <EBNF foo = "a" "b" [[ drop V{ 1 2 } ]] EBNF> <EBNF foo = "a" [[ drop 1 ]] "b" [[ drop 2 ]] EBNF> Unfortunately since this means the ebnf>quot code uses the equivalent of eval, it no longer compiles nicely since it can't be inferred. The generated parsers however do compile. |
||
---|---|---|
.. | ||
authors.txt | ||
ebnf-tests.factor | ||
ebnf.factor | ||
summary.txt | ||
tags.txt |