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

Document how to reset the parser after using feed #156

Closed
gajus opened this issue Jan 30, 2017 · 3 comments
Closed

Document how to reset the parser after using feed #156

gajus opened this issue Jan 30, 2017 · 3 comments
Labels

Comments

@gajus
Copy link

gajus commented Jan 30, 2017

const parser = new Parser(commandGrammar.ParserRules, commandGrammar.ParserStart);

const results = parser.feed(command).results;

How to reset the parser after feeding it some data?

@kach
Copy link
Owner

kach commented Jan 31, 2017

The easiest way is to just make a new parser.

@gajus
Copy link
Author

gajus commented Jan 31, 2017

Not the most efficient way, though.

It would be nice to have a simple "reset" function.

@tjvr
Copy link
Collaborator

tjvr commented Feb 16, 2017

Now the most efficient way, though.

It's actually very cheap.

@tjvr tjvr closed this as completed Feb 16, 2017
@tjvr tjvr added the question label Feb 16, 2017
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

3 participants