feat: add runtime error support with source paths, line info, and stack traces

Introduce primitive error signaling, runtime error handling with callstack printing, and fiber termination on error. Add source file path and method name tracking to functions, along with debug line number information. Update arithmetic operators to error on non-numeric operands and implement proper "method not found" runtime errors. Refactor the test runner to expect runtime errors with exit code 70 (EX_SOFTWARE) and update the C API to accept source paths in wrenInterpret and wrenCompile. Rename WrenNativeMethodFn to WrenForeignMethodFn and adjust related typedefs. Add debug source line arrays to compilers and functions, and replace the old debug dump functions with new print-based variants that display line numbers.
This commit is contained in:
Bob Nystrom
2014-01-01 21:25:24 +00:00
parent 8a09c03cdd
commit 547107a086
18 changed files with 563 additions and 376 deletions
@@ -0,0 +1 @@
1 / false // expect runtime error: TypeError: Right operand must be Num.
@@ -0,0 +1 @@
1 - false // expect runtime error: TypeError: Right operand must be Num.
+1
View File
@@ -0,0 +1 @@
1 % false // expect runtime error: TypeError: Right operand must be Num.
@@ -0,0 +1 @@
1 * false // expect runtime error: TypeError: Right operand must be Num.
@@ -0,0 +1,3 @@
1 + false // expect runtime error: TypeError: Right operand must be Num.
// TODO: What about a string on the RHS?