Convert parse errors to exceptions.

Parser no longer prints an error, but instead returns an exception ID
and message.
This commit is contained in:
Damien George
2014-01-15 21:23:31 +00:00
parent 24224d7c72
commit 9528cd66d7
9 changed files with 73 additions and 41 deletions

View File

@@ -62,4 +62,5 @@ typedef enum {
MP_PARSE_EVAL_INPUT,
} mp_parse_input_kind_t;
mp_parse_node_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind);
// returns MP_PARSE_NODE_NULL on error, and then exc_id_out and exc_msg_out are valid
mp_parse_node_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind, qstr *exc_id_out, const char **exc_msg_out);