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
The current layout preprocessor renders tokens as String to check whether they match layout keywords or { } ;. However, each keyword/symbol token comes with an ID that could be checked faster.
Steps to rewrite layout processor (generator) to use IDs instead of String:
LBNF: check whether { } ; occur in grammar when layout is used.
Give each symbol a name, like ( is LPAREN.
Define token constants in generated lexer for all the keywords and symbols.
Reference these constants in the layouter, rather than strings.
The text was updated successfully, but these errors were encountered:
I chose a different implementation path: Simply use TokSymbol (with the token ID) instead of String in the generated Layout.hs. We need not define constants for each token ID in the lexer. Could be still nice, but this is another issue.
The current layout preprocessor renders tokens as
String
to check whether they match layout keywords or{ } ;
. However, each keyword/symbol token comes with an ID that could be checked faster.Steps to rewrite layout processor (generator) to use IDs instead of
String
:{ } ;
occur in grammar whenlayout
is used.(
is LPAREN.The text was updated successfully, but these errors were encountered: