You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected result (in 0.12.0): UNKNOWN_DIM, STATIC_DIM, named_dim('n')
Actual result (in 1.2.2): named_dim('_'), STATIC_DIM, named_dim('n')
As you can see, _ is now parsed as named_dim, rather than UNKNOWN_DIM. But the grammar define UNKNOWN_DIM before named_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 ?
The text was updated successfully, but these errors were encountered:
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 ?
The text was updated successfully, but these errors were encountered: