Fixed an infinite loop

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 + " ".
This commit is contained in:
enderger 2019-11-20 08:47:58 -06:00 committed by GitHub
parent f0321d5b1d
commit cf64279293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -378,8 +378,9 @@
// We start by accepting an input string of code, and we're gonna set up two // We start by accepting an input string of code, and we're gonna set up two
// things... // things...
function tokenizer(input) { function tokenizer(p_input) {
let input = p_input + ' ';
// A `current` variable for tracking our position in the code like a cursor. // A `current` variable for tracking our position in the code like a cursor.
let current = 0; let current = 0;