diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-30 10:19:58 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-30 10:19:58 -0300 |
commit | 6087e67771d67a04efc1a067661ccd3a0d4ce40a (patch) | |
tree | 1747e4a5057b06454e727a02c79c438efcff7064 /llex.c | |
parent | 93bf6185048256a5df05986460f233ee65136731 (diff) | |
download | lua-6087e67771d67a04efc1a067661ccd3a0d4ce40a.tar.gz lua-6087e67771d67a04efc1a067661ccd3a0d4ce40a.tar.bz2 lua-6087e67771d67a04efc1a067661ccd3a0d4ce40a.zip |
no more compatibility option for long strings
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.20 2006/03/09 18:14:31 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.21 2006/07/11 15:53:29 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -222,8 +222,6 @@ static int skip_sep (LexState *ls) { | |||
222 | 222 | ||
223 | 223 | ||
224 | static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { | 224 | static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { |
225 | int cont = 0; | ||
226 | (void)(cont); /* avoid warnings when `cont' is not used */ | ||
227 | save_and_next(ls); /* skip 2nd `[' */ | 225 | save_and_next(ls); /* skip 2nd `[' */ |
228 | if (currIsNewline(ls)) /* string starts with a newline? */ | 226 | if (currIsNewline(ls)) /* string starts with a newline? */ |
229 | inclinenumber(ls); /* skip it */ | 227 | inclinenumber(ls); /* skip it */ |
@@ -233,26 +231,9 @@ static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { | |||
233 | luaX_lexerror(ls, (seminfo) ? "unfinished long string" : | 231 | luaX_lexerror(ls, (seminfo) ? "unfinished long string" : |
234 | "unfinished long comment", TK_EOS); | 232 | "unfinished long comment", TK_EOS); |
235 | break; /* to avoid warnings */ | 233 | break; /* to avoid warnings */ |
236 | #if defined(LUA_COMPAT_LSTR) | ||
237 | case '[': { | ||
238 | if (skip_sep(ls) == sep) { | ||
239 | save_and_next(ls); /* skip 2nd `[' */ | ||
240 | cont++; | ||
241 | #if LUA_COMPAT_LSTR == 1 | ||
242 | if (sep == 0) | ||
243 | luaX_lexerror(ls, "nesting of [[...]] is deprecated", '['); | ||
244 | #endif | ||
245 | } | ||
246 | break; | ||
247 | } | ||
248 | #endif | ||
249 | case ']': { | 234 | case ']': { |
250 | if (skip_sep(ls) == sep) { | 235 | if (skip_sep(ls) == sep) { |
251 | save_and_next(ls); /* skip 2nd `]' */ | 236 | save_and_next(ls); /* skip 2nd `]' */ |
252 | #if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2 | ||
253 | cont--; | ||
254 | if (sep == 0 && cont >= 0) break; | ||
255 | #endif | ||
256 | goto endloop; | 237 | goto endloop; |
257 | } | 238 | } |
258 | break; | 239 | break; |