Skip to content

Commit f82059b

Browse files
committed
Merge branch 'tokenizer-buffer-bug' of github.com:stephenharris/phpjs into stephenharris-tokenizer-buffer-bug
2 parents bfbc26b + d0c0a63 commit f82059b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

workbench/tokenizer/token_get_all.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,12 @@ function token_get_all (source) {
365365
}
366366
line += countNewLines(buffer);
367367
emitBuffer();
368-
i = pos + limit.length - 1;
368+
//If limit is not found, set i to the position of the end of the buffered characters
369+
if(pos === -1){
370+
i = i + buffer.length;
371+
}else{
372+
i = pos + limit.length - 1;
373+
}
369374
},
370375
//This function is used to split a double quoted string or a heredoc buffer after a variable
371376
//has been found inside it

0 commit comments

Comments
 (0)