compatibility with '%' syntax is optional

This commit is contained in:
Roberto Ierusalimschy
2003-02-11 08:49:53 -02:00
parent 7a40cdbda0
commit d674626392

View File

@@ -1,5 +1,5 @@
/* /*
** $Id: lparser.c,v 1.203 2002/12/19 11:11:55 roberto Exp roberto $ ** $Id: lparser.c,v 1.204 2003/02/11 10:46:24 roberto Exp roberto $
** Lua Parser ** Lua Parser
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@@ -644,12 +644,14 @@ static void prefixexp (LexState *ls, expdesc *v) {
singlevar(ls, v, 1); singlevar(ls, v, 1);
return; return;
} }
#ifdef LUA_COMPATUPSYNTAX
case '%': { /* for compatibility only */ case '%': { /* for compatibility only */
next(ls); /* skip `%' */ next(ls); /* skip `%' */
singlevar(ls, v, 1); singlevar(ls, v, 1);
check_condition(ls, v->k == VUPVAL, "global upvalues are obsolete"); check_condition(ls, v->k == VUPVAL, "global upvalues are obsolete");
return; return;
} }
#endif
default: { default: {
luaX_syntaxerror(ls, "unexpected symbol"); luaX_syntaxerror(ls, "unexpected symbol");
return; return;