AzureMarker / intellij-lalrpop

Jetbrains plugin for the LALRPOP parser-generator
MIT License
16 stars 2 forks source link

Unable to distinguish between macro calls and selected symbols #19

Open AzureMarker opened 3 years ago

AzureMarker commented 3 years ago

Originally found here: https://github.com/Mcat12/intellij-lalrpop/pull/17#issuecomment-729636357

Given this:

X: () = {};

Y: () = {};

F = {
    <a: X> Y <Y> => f(<>)
};

The alternative in F has 2 symbols: <a: X> and Y<Y>.

After diving into LALRPOP's code, it looks like their lexer emits either a MacroId or a normal Id depending on if there is an < immediately following an identifier (with no space in-between): https://github.com/lalrpop/lalrpop/blob/cba3a7463c014b8444623848219532628054e9a1/lalrpop/src/tok/mod.rs#L647