| 39 |
"end", "false", "for", "function", "if", |
"end", "false", "for", "function", "if", |
| 40 |
"in", "local", "nil", "not", "or", "repeat", |
"in", "local", "nil", "not", "or", "repeat", |
| 41 |
"return", "then", "true", "until", "while", |
"return", "then", "true", "until", "while", |
| 42 |
|
"..=", "+=", "-=", "*=", "/=", "^=", "%=", |
| 43 |
"..", "...", "==", ">=", "<=", "~=", |
"..", "...", "==", ">=", "<=", "~=", |
| 44 |
"<number>", "<name>", "<string>", "<eof>", |
"<number>", "<name>", "<string>", "<eof>", |
| 45 |
NULL |
NULL |
| 341 |
} |
} |
| 342 |
case '-': { |
case '-': { |
| 343 |
next(ls); |
next(ls); |
| 344 |
|
if (ls->current == '=') { |
| 345 |
|
next(ls); |
| 346 |
|
return TK_SUBASSIGN; |
| 347 |
|
} |
| 348 |
if (ls->current != '-') return '-'; |
if (ls->current != '-') return '-'; |
| 349 |
/* else is a comment */ |
/* else is a comment */ |
| 350 |
next(ls); |
next(ls); |
| 376 |
if (ls->current != '=') return '='; |
if (ls->current != '=') return '='; |
| 377 |
else { next(ls); return TK_EQ; } |
else { next(ls); return TK_EQ; } |
| 378 |
} |
} |
| 379 |
|
case '+': { |
| 380 |
|
next(ls); |
| 381 |
|
if (ls->current != '=') return '+'; |
| 382 |
|
else { next(ls); return TK_ADDASSIGN; } |
| 383 |
|
} |
| 384 |
|
case '*': { |
| 385 |
|
next(ls); |
| 386 |
|
if (ls->current != '=') return '*'; |
| 387 |
|
else { next(ls); return TK_MULASSIGN; } |
| 388 |
|
} |
| 389 |
|
case '/': { |
| 390 |
|
next(ls); |
| 391 |
|
if (ls->current != '=') return '/'; |
| 392 |
|
else { next(ls); return TK_DIVASSIGN; } |
| 393 |
|
} |
| 394 |
|
case '^': { |
| 395 |
|
next(ls); |
| 396 |
|
if (ls->current != '=') return '^'; |
| 397 |
|
else { next(ls); return TK_POWASSIGN; } |
| 398 |
|
} |
| 399 |
|
case '%': { |
| 400 |
|
next(ls); |
| 401 |
|
if (ls->current != '=') return '%'; |
| 402 |
|
else { next(ls); return TK_MODASSIGN; } |
| 403 |
|
} |
| 404 |
case '<': { |
case '<': { |
| 405 |
next(ls); |
next(ls); |
| 406 |
if (ls->current != '=') return '<'; |
if (ls->current != '=') return '<'; |
| 424 |
case '.': { |
case '.': { |
| 425 |
save_and_next(ls); |
save_and_next(ls); |
| 426 |
if (check_next(ls, ".")) { |
if (check_next(ls, ".")) { |
| 427 |
|
if (check_next(ls, "=")) |
| 428 |
|
return TK_CONCATASSIGN; |
| 429 |
if (check_next(ls, ".")) |
if (check_next(ls, ".")) |
| 430 |
return TK_DOTS; /* ... */ |
return TK_DOTS; /* ... */ |
| 431 |
else return TK_CONCAT; /* .. */ |
else |
| 432 |
|
return TK_CONCAT; /* .. */ |
| 433 |
} |
} |
| 434 |
else if (!isdigit(ls->current)) return '.'; |
else if (!isdigit(ls->current)) return '.'; |
| 435 |
else { |
else { |