Skip to content

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