[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Translating Lua keywords
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 11 Apr 2013 09:22:51 -0300
> In one case it is not as easy as in the others.
>
> "return" must be changed in the function "pushline" in lua.c too, in the
> line
> lua_pushfstring(L, "return %s", b+1); /* change it to `return' */
> otherwise you can't use the "=" shortcut in the interactive interpreter.
>
> This seems to be the only instance in the Lua source code outside the
> definition of `luaX_tokens` where a keyword occurs hard-coded in a
> string. The hard-coding can be avoided at the cost of making lua.c
> include llex.h.
lua.c is a client of the Lua core. 'return' is hardcoded there as it
is hardcoded in any piece of Lua code.
-- Roberto