Replies: 1 comment 2 replies
-
I think the standard way to handle this is to consistently treat ">" as a token, and then parse ">" ">" at that parser level. You have to be careful about avoiding ambiguities where you use ">>" in something inside a "<" ">" pair. Like if if your Anyways, the below toy example is valid lalrpop that handles both
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry if this was discussed already, but I can't figure out how to parse two consecutive tokens with no whitespace in between, to handle cases like
>>
in expression context while also handlingT1<T2<T3>>
andT1<T2<T3> >
in type context.Is this possible in lalrpop? Does anyone have any example code that does this?
Edit: Another use case that just came up while working on Fir is this:
Here I want
Vec [I32]
(note the space) to be parsed as production 3, not as 1.Beta Was this translation helpful? Give feedback.
All reactions