From 0ec8cf8e80ecdac77416a2d3fed861c95515d5df Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 30 May 2015 23:13:16 +0100 Subject: [PATCH] py/parsenum.c: Rename "raise" func to "raise_exc" to avoid name clash. "raise" is a common word that was found to exist in a vendor's stdlib. --- py/parsenum.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/py/parsenum.c b/py/parsenum.c index c11a846aa..9f85ae8bd 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -35,7 +35,7 @@ #include #endif -STATIC NORETURN void raise(mp_obj_t exc, mp_lexer_t *lex) { +STATIC NORETURN void raise_exc(mp_obj_t exc, mp_lexer_t *lex) { // if lex!=NULL then the parser called us and we need to make a SyntaxError with traceback if (lex != NULL) { ((mp_obj_base_t*)exc)->type = &mp_type_SyntaxError; @@ -146,11 +146,11 @@ value_error: if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { mp_obj_t exc = mp_obj_new_exception_msg(&mp_type_SyntaxError, "invalid syntax for integer"); - raise(exc, lex); + raise_exc(exc, lex); } else { mp_obj_t exc = mp_obj_new_exception_msg_varg(&mp_type_ValueError, "invalid syntax for integer with base %d: '%.*s'", base, top - str_val_start, str_val_start); - raise(exc, lex); + raise_exc(exc, lex); } } @@ -288,16 +288,16 @@ mp_obj_t mp_parse_num_decimal(const char *str, mp_uint_t len, bool allow_imag, b return mp_obj_new_complex(dec_val, 0); #else if (imag || force_complex) { - raise(mp_obj_new_exception_msg(&mp_type_ValueError, "complex values not supported"), lex); + raise_exc(mp_obj_new_exception_msg(&mp_type_ValueError, "complex values not supported"), lex); #endif } else { return mp_obj_new_float(dec_val); } value_error: - raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid syntax for number"), lex); + raise_exc(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid syntax for number"), lex); #else - raise(mp_obj_new_exception_msg(&mp_type_ValueError, "decimal numbers not supported"), lex); + raise_exc(mp_obj_new_exception_msg(&mp_type_ValueError, "decimal numbers not supported"), lex); #endif }