Operators comprised more than one symbols #1241
Answered
by
Guldoman
nsgnkhibdk2cls0f
asked this question in
Q&A
-
On lexer file, operators is defined as a string without any delimiter between the symbols like this:
Then how could we handle operators comprised more than one symbols like |
Beta Was this translation helpful? Give feedback.
Answered by
Guldoman
Dec 16, 2022
Replies: 1 comment
-
You can add other patterns that have type That pattern will still apply to { pattern = ":=", type = "operator" }, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nsgnkhibdk2cls0f
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add other patterns that have type
operator
.That pattern will still apply to
>>
,<<
,>>>
,<<<
,->
and<>
, as the tokenizer will apply theoperator
token type to each character.:=
might instead result in:
matching with some other rule and=
matching asoperator
.So to make it match the entire
:=
you can add a rule like: