Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Necessary imports not included in Lark standalone parsers. #1059

Closed
shiyunon opened this issue Dec 18, 2021 · 2 comments
Closed

Necessary imports not included in Lark standalone parsers. #1059

shiyunon opened this issue Dec 18, 2021 · 2 comments
Labels

Comments

@shiyunon
Copy link

shiyunon commented Dec 18, 2021

Describe the bug

To generate Lark standalone parsers for users (those users using python -m lark.tools.standalone), in lark/tools/standalone.py, necessary file sections are included in the final standalone parser. These necessary files are defined on line 56 in lark/tools/standalone.py in the Python list EXTRACT_STANDALONE_FILES. This list includes visitors.py (on line 61). The included section of visitors.py (in any standalone parsers) is from line 10 to line 518 (of visitors.py). However, on line 431 of visitors.py, update_wrapper function is used, but the import line from functools import wraps, update_wrapper is on line 3 of visitors.py and not in the included section (line 10-518 of visitors.py) in the generated standalone parser. Thus, a bug can be generated if line 431 is called in any standalone parsers.

@erezsh erezsh added the bug label Dec 19, 2021
@erezsh
Copy link
Member

erezsh commented Dec 19, 2021

You're right. It will happen if you try to decorate a class with v_args, which I guess no one has tried with the standalone parser yet.

Good catch!

@erezsh
Copy link
Member

erezsh commented Jan 15, 2022

Should be solved in master. I'll probably make a v1.1 release in the coming weeks.

@erezsh erezsh closed this as completed Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants