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

Different infinite loop #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

enderger
Copy link

There is actually another infinite loop in the code. When testing, I found that this would hang.:
console.log(lexer("add"));
This is caused by the while loop for names assuming that there is always a character following text. This patch fixes this by adding a space to the end of the lexer input, which is used to cause these while loops to exit.

When dealing with certain checks, namely the name check, the code can enter an infinite loop if the file end is reached during the while loop. The solution was to change the parameter to p_input and make a local variable called input that is equal to p_input + " ".
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

Successfully merging this pull request may close these issues.

1 participant