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

Unnecessary options "_plugins" included in the generated parser #13

Closed
jillyj opened this issue Mar 3, 2022 · 8 comments
Closed

Unnecessary options "_plugins" included in the generated parser #13

jillyj opened this issue Mar 3, 2022 · 8 comments

Comments

@jillyj
Copy link
Contributor

jillyj commented Mar 3, 2022

When I tried lark-js to generate the parser from .lark file, the parser includes "_plugins": {} in to the parser file which resulted to the console error.

Grammar file: https://github.com/opencybersecurityalliance/kestrel-lang/blob/develop/src/kestrel/syntax/kestrel.lark[](https://user-images.githubusercontent.com/47232763/155667411-4bba3c14-846f-4082-882d-65645eceb8f5.png)

image

erezsh added a commit that referenced this issue Mar 3, 2022
Fixed compatibility with latest lark.

Bugfix for UnexpectedToken.expected
@erezsh
Copy link
Member

erezsh commented Mar 3, 2022

Fixed and released as version 0.1.1

@erezsh erezsh closed this as completed Mar 3, 2022
@jillyj
Copy link
Contributor Author

jillyj commented Mar 4, 2022

I tried against 0.11, but still got the _plugins in the generated parser file in the var DATA object. Would you please check again?
image

@erezsh
Copy link
Member

erezsh commented Mar 4, 2022

I wasn't trying to remove _plugins. But the latest version should work even when it's there.

@jillyj
Copy link
Contributor Author

jillyj commented Mar 7, 2022

But I still got the same console error with the generated parser with version 0.1.1.

@jillyj
Copy link
Contributor Author

jillyj commented Mar 7, 2022

This is what I got from the json_parser.js created by json.lark in the example folder.
image

@erezsh
Copy link
Member

erezsh commented Mar 7, 2022

Are you sure you're using the latest Lark.js? Did you install it with pip install -U lark-js ?

@erezsh
Copy link
Member

erezsh commented Mar 7, 2022

Afterwards, you also need to use it to regenerate the js parser, of course.

@jillyj
Copy link
Contributor Author

jillyj commented Mar 8, 2022

Oh, you are right. I installed the updated version to wrong python venv. Now it works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants