lua-users home
lua-l archive

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

>From Tue Jun 23 04:24:33 1998
>Speaking of errors, I wish there was a seperate error reporting mechanism
>and api for parse errors. Requiring the debugger to parse the parse error
>makes for a fragile interface.

I'm not sure what you mean here. What API would you suggest for parsing?

Our philosophy is of course keep-it-simple. In this case, we assume that a
parse error is an error. We even stop compiling at the first error.

If you really want to tell parse errors from run time errors, then you may
use the call hook: it receives line=0 at the start of a chunk.
Thus, errors that happen before this hook is called are parse errors.
Alternatively, you can look at luac.c and see how to parse without running.
In this way, you may set different error handlers for parsing and for running.