This overload makes a Matcher that chooses between two given matchers based on a condition. This makes possible to allow/disallow a grammar based on context/options.
decide and chain allow for more complex dynamic rules.
Condition.
Data object (tokens and options).
Parser position in the tokens array (before parsing).
Matcher to run when the condition is true.
Matcher to run when the condition is false.
Make a parser that chooses between two given parsers based on a condition. This makes possible to allow/disallow a grammar based on context/options.
Parser to run when the condition is true.
Parser to run when the condition is false.
This overload makes a Matcher that chooses between two given matchers based on a condition. This makes possible to allow/disallow a grammar based on context/options.
decide and chain allow for more complex dynamic rules.