Open Conchylicultor opened 3 weeks ago
Hello @Conchylicultor ,
Can you please check if this PR fixes your issue?
To your question -
Why did the resolution order changed ?
Hard to say, but I imagine it probably happened between 0.12.x and 1.0.0
We made a lot of improvements to the Earley parser (and we still do), and it's possible that the order of the derivations change. (though we try to keep that to a minimum)
Is there a param to fix the issue ?
Usually, using a priority is the easiest way to choose between derivations. ( .e.g. preferred_rule.100: subrule1 subrule2 ..
)
Also consider using ambiguity='explicit'
and choosing the correct derivations on your side.
Our project was working well in past version, but seems to be broken with the current lark version. Reproduction:
0.12.0
):UNKNOWN_DIM, STATIC_DIM, named_dim('n')
1.2.2
):named_dim('_'), STATIC_DIM, named_dim('n')
As you can see,
_
is now parsed asnamed_dim
, rather thanUNKNOWN_DIM
. But the grammar defineUNKNOWN_DIM
beforenamed_dim
so I would expect the resolution order to match the code.We tried with
ambiguity='resolve'
but this didn't changed anything.Why did the resolution order changed ? Is there a param to fix the issue ?