no more compatibility option for long strings
This commit is contained in:
21
llex.c
21
llex.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: llex.c,v 2.20 2006/03/09 18:14:31 roberto Exp roberto $
|
** $Id: llex.c,v 2.21 2006/07/11 15:53:29 roberto Exp roberto $
|
||||||
** Lexical Analyzer
|
** Lexical Analyzer
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -222,8 +222,6 @@ static int skip_sep (LexState *ls) {
|
|||||||
|
|
||||||
|
|
||||||
static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
|
static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
|
||||||
int cont = 0;
|
|
||||||
(void)(cont); /* avoid warnings when `cont' is not used */
|
|
||||||
save_and_next(ls); /* skip 2nd `[' */
|
save_and_next(ls); /* skip 2nd `[' */
|
||||||
if (currIsNewline(ls)) /* string starts with a newline? */
|
if (currIsNewline(ls)) /* string starts with a newline? */
|
||||||
inclinenumber(ls); /* skip it */
|
inclinenumber(ls); /* skip it */
|
||||||
@@ -233,26 +231,9 @@ static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
|
|||||||
luaX_lexerror(ls, (seminfo) ? "unfinished long string" :
|
luaX_lexerror(ls, (seminfo) ? "unfinished long string" :
|
||||||
"unfinished long comment", TK_EOS);
|
"unfinished long comment", TK_EOS);
|
||||||
break; /* to avoid warnings */
|
break; /* to avoid warnings */
|
||||||
#if defined(LUA_COMPAT_LSTR)
|
|
||||||
case '[': {
|
|
||||||
if (skip_sep(ls) == sep) {
|
|
||||||
save_and_next(ls); /* skip 2nd `[' */
|
|
||||||
cont++;
|
|
||||||
#if LUA_COMPAT_LSTR == 1
|
|
||||||
if (sep == 0)
|
|
||||||
luaX_lexerror(ls, "nesting of [[...]] is deprecated", '[');
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
case ']': {
|
case ']': {
|
||||||
if (skip_sep(ls) == sep) {
|
if (skip_sep(ls) == sep) {
|
||||||
save_and_next(ls); /* skip 2nd `]' */
|
save_and_next(ls); /* skip 2nd `]' */
|
||||||
#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2
|
|
||||||
cont--;
|
|
||||||
if (sep == 0 && cont >= 0) break;
|
|
||||||
#endif
|
|
||||||
goto endloop;
|
goto endloop;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
10
luaconf.h
10
luaconf.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: luaconf.h,v 1.83 2006/08/04 13:34:37 roberto Exp roberto $
|
** $Id: luaconf.h,v 1.84 2006/08/07 19:14:30 roberto Exp roberto $
|
||||||
** Configuration file for Lua
|
** Configuration file for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -342,14 +342,6 @@
|
|||||||
*/
|
*/
|
||||||
#define LUA_COMPAT_MOD
|
#define LUA_COMPAT_MOD
|
||||||
|
|
||||||
/*
|
|
||||||
@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
|
|
||||||
@* facility.
|
|
||||||
** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
|
|
||||||
** off the advisory error when nesting [[...]].
|
|
||||||
*/
|
|
||||||
#define LUA_COMPAT_LSTR 1
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
|
@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
|
||||||
** CHANGE it to undefined as soon as you rename 'string.gfind' to
|
** CHANGE it to undefined as soon as you rename 'string.gfind' to
|
||||||
|
|||||||
Reference in New Issue
Block a user