Replies: 1 comment 4 replies
-
Hey Tim! Your best bet is probably
|
Beta Was this translation helpful? Give feedback.
4 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Hi @alecthomas
I am trying to create a parser which, in one area, parses a list of arbitrary expressions (which can contain any character apart from semicolon) separated by semicolons. I'm struggling to get the expressions to be lexed as single tokens so they can be captured, since as they can be more or less anything the token definitions overlap with other things such as Ident, strings etc.
Any thoughts on how this can be accomplished? Please note I am not trying to parse the expressions themselves, I am happy to just select anything between the semicolons as strings. I can get this to work by surrounding the expressions with double quotes (because then they match the String token), but I don't want this in the actual language as I think it's uglier than using semicolons.
Here's a test that demonstrates the issue:
Thanks in advance for the help!
Beta Was this translation helpful? Give feedback.
All reactions