Describe the bug
I defined the following grammar with ambiguity enabled. The parser raised and error and automatically suggested me to report the bug.
Note. The example below is a minimal example of my real use case.
To Reproduce
# Bug report
from lark import Lark, UnexpectedCharacters
grammar = """
start: "<p>" text ("<b>" bold "</b>")* CLOSE?
text: /.+/
bold: /.+/
CLOSE: "</p>"
%ignore CLOSE
%import common.WS
"""
# Use ambiguity='explicit' to see all possible trees
parser = Lark(grammar, start='start', ambiguity='explicit', lexer='dynamic_complete')
text = "<p>Press the <b>button</b>.</p>"
print(text)
try:
print(parser.parse(text).pretty())
except UnexpectedCharacters:
print("No matches")
Output:
RuntimeError: Earley should not generate multiple start symbol items! Please report this bug.
Describe the bug
I defined the following grammar with ambiguity enabled. The parser raised and error and automatically suggested me to report the bug.
Note. The example below is a minimal example of my real use case.
To Reproduce
Output:
RuntimeError: Earley should not generate multiple start symbol items! Please report this bug.