diff options
Diffstat (limited to '')
| -rw-r--r-- | llex.c | 12 |
1 files changed, 3 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llex.c,v 1.18 1998/03/20 14:18:18 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.19 1998/05/27 13:03:40 roberto Exp roberto $ |
| 3 | ** Lexical Analizer | 3 | ** Lexical Analizer |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -339,11 +339,6 @@ int luaX_lex (LexState *LS) { | |||
| 339 | case 't': save('\t'); next(LS); break; | 339 | case 't': save('\t'); next(LS); break; |
| 340 | case 'v': save('\v'); next(LS); break; | 340 | case 'v': save('\v'); next(LS); break; |
| 341 | case '\n': save('\n'); inclinenumber(LS); break; | 341 | case '\n': save('\n'); inclinenumber(LS); break; |
| 342 | case '\\': case '"': case '\'': case '?': { | ||
| 343 | save(LS->current); | ||
| 344 | next(LS); | ||
| 345 | break; | ||
| 346 | } | ||
| 347 | default : { | 342 | default : { |
| 348 | if (isdigit(LS->current)) { | 343 | if (isdigit(LS->current)) { |
| 349 | int c = 0; | 344 | int c = 0; |
| @@ -356,10 +351,9 @@ int luaX_lex (LexState *LS) { | |||
| 356 | luaX_error(LS, "escape sequence too large"); | 351 | luaX_error(LS, "escape sequence too large"); |
| 357 | save(c); | 352 | save(c); |
| 358 | } | 353 | } |
| 359 | else { | 354 | else { /* handles \, ", ', and ? */ |
| 360 | save('\\'); | ||
| 361 | save(LS->current); | 355 | save(LS->current); |
| 362 | luaX_error(LS, "invalid escape sequence"); | 356 | next(LS); |
| 363 | } | 357 | } |
| 364 | break; | 358 | break; |
| 365 | } | 359 | } |
