py: For viper compile errors, add traceback with function and filename.

ViperTypeError now includes filename and function name where the error
occurred.  The line number is the line number of the start of the
function definition, which is the best that can be done without a lot
more work.

Partially addresses issue #1381.
This commit is contained in:
Damien George
2015-07-27 22:20:00 +01:00
parent d8a7f8bff2
commit 84d59c2873
2 changed files with 18 additions and 7 deletions

View File

@@ -677,7 +677,7 @@ STATIC void emit_native_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scop
// right now we have a restriction of maximum of 4 arguments
if (scope->num_pos_args >= 5) {
EMIT_NATIVE_VIPER_TYPE_ERROR(emit, "Viper functions don't currently support more than 4 arguments (while compiling '%q')", scope->simple_name); return;
EMIT_NATIVE_VIPER_TYPE_ERROR(emit, "Viper functions don't currently support more than 4 arguments");
return;
}