diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-06-06 17:44:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-06-06 17:44:05 -0300 |
commit | 7dfa9520911e147be04a0dc04b21bcb01e045f76 (patch) | |
tree | 09c17d063c2672e39248723e9e2521dd668969bb | |
parent | 02134b4a8791aad79b21d75fb8cef6a3a908a767 (diff) | |
download | lua-7dfa9520911e147be04a0dc04b21bcb01e045f76.tar.gz lua-7dfa9520911e147be04a0dc04b21bcb01e045f76.tar.bz2 lua-7dfa9520911e147be04a0dc04b21bcb01e045f76.zip |
no more error for '\x' (with "invalid" x)
-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 | } |