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

Optimization on &OR -> AddExpected #6

Open
akvlad opened this issue Nov 21, 2022 · 1 comment
Open

Optimization on &OR -> AddExpected #6

akvlad opened this issue Nov 21, 2022 · 1 comment
Assignees

Comments

@akvlad
Copy link

akvlad commented Nov 21, 2022

Hello.
First of all, thanks for (as I believe) the only working BNF powered script parser for NodeJS.

On the other hand it has some flaws obstructing the usage.
In particular I saw the problem:

for( let i = 0; i < token._tokenTrees.length - 1; i++ ){

When I comment out the for loop it parses an invalid expression in 73ms.
When I uncomment the loop it needs about 3s to parse the expression.

As far as I see, the loop is connected to gathering expected tokens in case of error. Can it be preprocessed upon the creation? Can some internal loops be omitted? What is the LHF you mentioned?

@daKuleMune
Copy link
Owner

It is time to do an update to new versions of node again. Also, the first pass debugging never quite worked correctly in catching syntax errors, and I never got back around to fixing the issue. I will assign myself this issue and work on a version bump for node 10+ support as well as first pass improvements.
LHF meant Low Hanging Fruit, things that were simple optimizations that anyone interested in the repo could contribute to, or myself given time.

@daKuleMune daKuleMune self-assigned this Nov 21, 2022
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