Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions super-tiny-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ function tokenizer(input) {
// Then we're going to loop through each character in the sequence until
// we encounter a character that is not a number, pushing each character
// that is a number to our `value` and incrementing `current` as we go.
while (NUMBERS.test(char)) {
while (current < input.length && NUMBERS.test(char)) {
value += char;
char = input[++current];
}
Expand All @@ -447,7 +447,7 @@ function tokenizer(input) {
// Name token
//
var LETTERS = /[a-z]/i;
if (LETTERS.test(char)) {
if (current < input.length && LETTERS.test(char)) {
var value = '';

// Again we're just going to loop through all the letters pushing them to
Expand Down