lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I tried to store some data in the lua registry during script parsing. If I call

switch(ls->t.token) {
case TK_IF:
....

case TK_MY_OWN_TOKEN:
lua_pushstring(ls->L, "hello world");
lua_pop(ls->L, 1);
}

in lparser.c/statement(), my program usually crashes. So my question is:
Is it allowed to use lua API functions like lua_pushstring, lua_newtable,
lua_gettable etc. to store data in the registry while lua is in parsing mode?

Or should those functions only be used in lua libraries?

Greets

Andreas  
--
"Remember: It's nice to be important but it's more important to be nice!"