Bug in handling ambiguity?
See original GitHub issueWhen running this code:
grammar = """
expression: "c" | "d" | "c" "d"
unit: expression "a"
| "a" expression
| "b" unit
| "b" expression
start: unit*
%import common.WS
%ignore WS
"""
l = Lark(grammar, parser='earley', ambiguity='explicit')
print(l.parse('b c d a a c').pretty())
It is expected to have an ambiguous parse, but there is no ‘_ambig’ node.
At least these options are valid:
unit(
b
unit(
expression(
c
d
)
a
)
)
unit(
a
expression(
c
)
)
and this parse:
unit(
b
expression(
c
)
)
unit(
expression(
d
)
a
)
unit(
a
expression(
c
)
)
The only parse that comes back is the second one.
When one removes the "b" expression
option, you get the first one.
Issue Analytics
- State:
- Created 6 years ago
- Comments:67 (31 by maintainers)
Top Results From Across the Web
How to Deal With Ambiguity: Guidelines and Resources
“Ambiguity is a type of meaning in which a phrase, statement or resolution is not explicitly defined, making several interpretations plausible.
Read more >CSCvf21978 - ISE failing to resolve ambiguity for ... - Cisco Bug
Conditions: This problem appear when ambiguity is presented in Active Directory: Ambiguity means case when user enters a short identity as a username...
Read more >Ambiguity is a feature of natural languages, it's not a bug. It's ...
Ambiguity is a feature of natural languages, it's not a bug. ... The only reason certain words' meanings don't change is because people...
Read more >'It's Not a Bug, It's a Feature.' Trite—or Just Right? - WIRED
It's not a bug, it's a feature is an acknowledgment, half comic, half tragic, of the ambiguity that has always haunted computer programming....
Read more >326778 – Questionable ambiguity if both using declaration ...
Bugzilla – Bug 326778 Questionable ambiguity if both using declaration and using directive is used Last modified: 2010-10-07 03:17:43 EDT.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed! At the very least, the example you gave me now runs almost instantly. Please check if latest master fixes your issues.
Turns out it was a very simple bug, but it was a real flaw in my implementation. So thank you for reporting it and helping me weed it out.
See if you can find an example of name length affecting speed. I’ll be very happy to fix it if it’s true.
In
master
.