I use lark to parse a C-like language. Among other, it has operators && (boolean AND), & (bitwise AND), and & (address of). Since boolean AND has lower priority than the other two, when parsing expressions like a < b && c < d it gets parsed as (a < b) & (&c < d). Is there a way to force the lexer to always treat double ampersand as a single token? Or maybe there's another way to write my grammar?
For the reference, the grammar for my language is here.
I use lark to parse a C-like language. Among other, it has operators
&&
(boolean AND),&
(bitwise AND), and&
(address of). Since boolean AND has lower priority than the other two, when parsing expressions likea < b && c < d
it gets parsed as(a < b) & (&c < d)
. Is there a way to force the lexer to always treat double ampersand as a single token? Or maybe there's another way to write my grammar? For the reference, the grammar for my language is here.