You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature suggestion: writing a grammar rule in terms of tokens that have different definitions depending on the scanner state…
%states default insideBraces insideParens;
insideBraces <any> : [^{}]+ ;
insideBraces <leftDelimiter> : \{ ;
insideBraces <rightDelimiter> : \} ;
insideParens <any> : [^()]+ ;
insideParens <leftDelimiter> : \( ;
insideParens <rightDelimiter> : \) ;
# this rule would only be used when the scanner is in one of the two states above
DelimitedContent
: <any> 'content' {{}}
| <leftDelimiter> 'content'
DelimitedContent 'content' *
<rightDelimiter> 'content' {{}}
;
The text was updated successfully, but these errors were encountered:
After discussion with @ToshRaka I got a working parser by duplicating the rule into ParenthesizedContent and BracedContent, and the <any> tokens into <notBraces> and <notParens>.
Feature suggestion: writing a grammar rule in terms of tokens that have different definitions depending on the scanner state…
The text was updated successfully, but these errors were encountered: