[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: From C, checking script syntax
- From: Miles Bader <miles@...>
- Date: Mon, 30 Nov 2009 09:52:21 +0900
"Murray S. Kucherawy" <firstname.lastname@example.org> writes:
> -- test script; "ctx" is a global context pointer exported from C
> io.write(xfoo(ctx, "hi there"), "\n")
> ...lua_load() doesn't complain at all. Only if I use lua_pcall() will
> I get some kind of error report out.
lua_load _can't_ complain, because there is no syntax error.
Lua doesn't know that xfoo is nil until it evaluates it.
Try the same thing after deleting the final parentheses from the test
script (so it has mismatched parentheses) for instance, and you'll get
an error report from lua_load.
"Most attacks seem to take place at night, during a rainstorm, uphill,
where four map sheets join." -- Anon. British Officer in WW I