Matching identifiers except set of keywords #309
Unanswered
garretfick
asked this question in
Q&A
Replies: 1 comment
-
I found an example that implements the desired behavior (excluding the case sensitivity part):
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use rust-peg to parse IEC 61121 Structured Text (ST). You probably haven't heard of it, that's ok. I'm stuck trying to differentiate between identifiers and keywords.
For example, I have the rule to match an identifier, which is:
However, there is a set of keywords that are not allowed as identifiers, for example
while
.Presently, the grammar is matching
while
as an identifier. Is there some way to exclude a set of keywords (case insensitive of course) from a pattern match?Beta Was this translation helpful? Give feedback.
All reactions