lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.77k stars 404 forks source link

Ugly exceptions during invalid code parsing #1257

Closed Scony closed 1 year ago

Scony commented 1 year ago

Describe the bug

Ugly exceptions during invalid code parsing

To Reproduce

pip install gdtoolkit and then steps from: https://github.com/Scony/godot-gdscript-toolkit/issues/202

GDToolkit uses lark 1.1.5.

MegaIng commented 1 year ago

Can you please provide a minimal example? Working through an entire unfamiliar library and grammar is a lot of effort. If you provide a minimal self contained example, the process to fixing this will be massively speedup.

Scony commented 1 year ago

The thing is - I cannot reproduce it with fairly straightforward grammar.

MegaIng commented 1 year ago

Does it sill happen if you use the most recent master instead of the latest release?

MegaIng commented 1 year ago

It's probably a duplicate of the recently fixed #1154

Scony commented 1 year ago

@MegaIng you were right, with the following changes in setup.py:

-        "lark[regex]==1.1.5",
+        # "lark[regex]==1.1.5",
+        'lark[regex]@git+ssh://git@github.com/lark-parser/lark.git@2564232e0a6f2dbd15a25917129d3b773bd5e18f#egg=lark[regex]',

I could see the issue is no more. Therefore it's indeed a dup of #1154