diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2020-03-02 22:35:22 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-04-05 15:02:06 +1000 |
commit | def76fe4d9bbc2c342594dc05861b24d7165d274 (patch) | |
tree | d04ad778e2421de0a85835227ba5bcb08562ec24 /py/parse.c | |
parent | 85858e72dfdc3e941c2e620e94de05ad663138b1 (diff) |
all: Use MP_ERROR_TEXT for all error messages.
Diffstat (limited to 'py/parse.c')
-rw-r--r-- | py/parse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/parse.c b/py/parse.c index 8b68fd35e..6ac544733 100644 --- a/py/parse.c +++ b/py/parse.c @@ -714,7 +714,7 @@ STATIC bool fold_constants(parser_t *parser, uint8_t rule_id, size_t num_args) { mp_obj_t value; if (!mp_parse_node_get_int_maybe(pn_value, &value)) { mp_obj_t exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, - "constant must be an integer"); + MP_ERROR_TEXT("constant must be an integer")); mp_obj_exception_add_traceback(exc, parser->lexer->source_name, ((mp_parse_node_struct_t *)pn1)->source_line, MP_QSTRnull); nlr_raise(exc); @@ -1144,13 +1144,13 @@ mp_parse_tree_t mp_parse(mp_lexer_t *lex, mp_parse_input_kind_t input_kind) { mp_obj_t exc; if (lex->tok_kind == MP_TOKEN_INDENT) { exc = mp_obj_new_exception_msg(&mp_type_IndentationError, - "unexpected indent"); + MP_ERROR_TEXT("unexpected indent")); } else if (lex->tok_kind == MP_TOKEN_DEDENT_MISMATCH) { exc = mp_obj_new_exception_msg(&mp_type_IndentationError, - "unindent doesn't match any outer indent level"); + MP_ERROR_TEXT("unindent doesn't match any outer indent level")); } else { exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, - "invalid syntax"); + MP_ERROR_TEXT("invalid syntax")); } // add traceback to give info about file name and location // we don't have a 'block' name, so just pass the NULL qstr to indicate this |