summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2022-09-16 19:55:42 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-09-18 08:01:20 -0400
commit7574659452a864e762fa812cb38cf15f70d85617 (patch)
treeed28b4b8470f83e520d664f72f805b58f18033a3 /testsuite/tests/printer
parent780371678fae6cc4ab08a029f5cc35c73de2dc4b (diff)
downloadhaskell-7574659452a864e762fa812cb38cf15f70d85617.tar.gz
Lexer: define varsym without predicates (#22201)
Before this patch, the varsym lexing rules were defined as follows: <0> { @varsym / { precededByClosingToken `alexAndPred` followedByOpeningToken } { varsym_tight_infix } @varsym / { followedByOpeningToken } { varsym_prefix } @varsym / { precededByClosingToken } { varsym_suffix } @varsym { varsym_loose_infix } } Unfortunately, this meant that the predicates 'precededByClosingToken' and 'followedByOpeningToken' were recomputed several times before we could figure out the whitespace context. With this patch, we check for whitespace context directly in the lexer action: <0> { @varsym { with_op_ws varsym } } The checking for opening/closing tokens happens in 'with_op_ws' now, which is part of the lexer action rather than the lexer predicate.
Diffstat (limited to 'testsuite/tests/printer')
0 files changed, 0 insertions, 0 deletions