Skip to content

Optimization on &OR -> AddExpected #6

@akvlad

Description

@akvlad

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions