Skip to content

Commit b643de3

Browse files
committed
Use codepoint 0x0 for EOF
- This prevents the parseerror message show "0x-1". - There is no \x00, which has been replaced during preprocessing, in the input codepoints.
1 parent b54ab4b commit b643de3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

parse-css.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function tokenize(str) {
106106

107107
var codepoint = function(i) {
108108
if(i >= str.length) {
109-
return -1;
109+
return 0;
110110
}
111111
return str[i];
112112
}
@@ -141,7 +141,7 @@ function tokenize(str) {
141141
};
142142
var eof = function(codepoint) {
143143
if(codepoint === undefined) codepoint = code;
144-
return codepoint == -1;
144+
return codepoint == 0;
145145
};
146146
var donothing = function() {};
147147
var parseerror = function() { console.log("Parse error at index " + i + ", processing codepoint 0x" + code.toString(16) + ".");return true; };

0 commit comments

Comments
 (0)