static void prefixexp (LexState *ls, expdesc *v) { /* prefixexp -> NAME | '(' expr ')' */ switch (ls->t.token) { case '(': { int line = ls->linenumber; next(ls); expr(ls, v); check_match(ls, ')', '(', line); luaK_dischargevars(ls->fs, v); return; } case TK_NAME: { singlevar(ls, v, 1); return; } #ifdef LUA_COMPATUPSYNTAX case '%': { /* for compatibility only */ TString *varname; int line = ls->linenumber; next(ls); /* skip `%' */ varname = singlevar(ls, v, 1); if (v->k != VUPVAL) luaX_errorline(ls, "global upvalues are obsolete", getstr(varname), line); return; } #endif default: { luaX_syntaxerror(ls, "unexpected symbol"); return; } } }
static void luaX_error (LexState *ls, const char *s, const char *token) { luaX_errorline(ls, s, token, ls->linenumber); }