Fix lexer bugs.
Wrong work with spaces.
This commit is contained in:
@@ -589,6 +589,13 @@ public class LexState extends Constants {
|
|||||||
inclinenumber();
|
inclinenumber();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case ' ':
|
||||||
|
case '\f':
|
||||||
|
case '\t':
|
||||||
|
case 0x0B: /* \v */ {
|
||||||
|
nextChar();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
case '-': {
|
case '-': {
|
||||||
nextChar();
|
nextChar();
|
||||||
if (current != '-')
|
if (current != '-')
|
||||||
@@ -692,11 +699,7 @@ public class LexState extends Constants {
|
|||||||
return TK_EOS;
|
return TK_EOS;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if (isspace(current)) {
|
if (isalpha(current) || current == '_') {
|
||||||
_assert (!currIsNewline());
|
|
||||||
nextChar();
|
|
||||||
continue;
|
|
||||||
} else if (isalpha(current) || current == '_') {
|
|
||||||
/* identifier or reserved word */
|
/* identifier or reserved word */
|
||||||
LuaString ts;
|
LuaString ts;
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user