[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What would you recommend as best way to translate Lua to Esperanto
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 20 Jun 2016 12:36:46 -0300
> I suggest you start with setting up an alias "egalas" for "==" to see how it works.
Add these lines to luaX_init:
{
TString *ts = luaS_new(L, "egalas");
luaC_fix(L, obj2gco(ts)); /* reserved words are never collected */
ts->extra = cast_byte(TK_EQ+1-FIRST_RESERVED); /* reserved word */
}
Rebuild Lua and try this:
a=1
b=3-2
if a egalas b then
print("ok")
end
This technique works for all multi-byte tokens but not for single-byte tokens.