py: Make viper codegen raise proper exception (ViperTypeError) on error.

This fixes a long standing problem that viper code generation gave
terrible error messages, and actually no errors on pyboard where
assertions are disabled.

Now all compile-time errors are raised as proper Python exceptions, and
are of type ViperTypeError.

Addresses issue #940.
This commit is contained in:
Damien George
2015-04-20 13:29:31 +00:00
parent 2bb5f41611
commit c8b60f013b
7 changed files with 74 additions and 38 deletions

View File

@@ -434,6 +434,7 @@ extern const mp_obj_type_t mp_type_SystemExit;
extern const mp_obj_type_t mp_type_TypeError;
extern const mp_obj_type_t mp_type_UnicodeError;
extern const mp_obj_type_t mp_type_ValueError;
extern const mp_obj_type_t mp_type_ViperTypeError;
extern const mp_obj_type_t mp_type_ZeroDivisionError;
// Constant objects, globally accessible