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

Chevrotain CST creation and content security policy. #11

Open
bd82 opened this issue Apr 11, 2018 · 4 comments
Open

Chevrotain CST creation and content security policy. #11

bd82 opened this issue Apr 11, 2018 · 4 comments

Comments

@bd82
Copy link

bd82 commented Apr 11, 2018

Hello. 😄
I saw this comment:

The issue with content security policy (new Function)
was resolved in version 3
https://github.com/SAP/chevrotain/blob/master/CHANGELOG.md#300-2-23-2018

But there have been many breaking changes since 0.34 so an upgrade would require a time investment.

@moltenform
Copy link
Owner

Thank you for notifying me, I have been focusing on so many other things that I didn't see that the new version was released.

If the new version is faster, it might be worth upgrading :) . (I don't have any complaints about the speed, though, I have been very impressed with Chevrotain's speed.) I use a Python script to generate my grammar, and so changes in that area I could accommodate fairly quickly.

I'm the one who submitted a PR for the issue so the update probably contains my code :)

@moltenform
Copy link
Owner

Leaving this issue open until I look what the new version of Chevrotain offers.

@bd82
Copy link
Author

bd82 commented Apr 12, 2018

have been focusing on so many other things that I didn't see that the new version was released.

Try integrating with greenkeeper to monitor dependency updates.

I use a Python script to generate my grammar, and so changes in that area I could accommodate fairly quickly

There have also been breaking changes to the CST structure/Visitor and even the way tokens have been defined. 😢

If you do meta programming (generating the grammar) you may be interested in the support
for custom grammar apis
it includes code generation APIs.

I'm the one who submitted a PR for the issue so the update probably contains my code

Almost, you brought the problem to my attention 👍 , but the solution was to simplify the CST structure and avoid the empty arrays for unmatched [non]Terminals. So the optimizations were no longer needed during CST initialization.

if the new version is faster, it might be worth upgrading

The main upgrade is the CST creation optimization
There is also another very large lexer performance upgrade that will be released soon.
As the library is actively developed, its best to upgrade before the delta of breaking changes gets too large. 😄

@bd82
Copy link
Author

bd82 commented Apr 13, 2018

Version 3.1 is out now with large lexer performance boost.
(e.g, 60% for CSS grammar).

With the combined performance of multiple optimizations it is even possible you would get X2 the performance by upgrading...

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

No branches or pull requests

2 participants