feat: add compile error detection and line tracking to test runner and compiler

Add support for testing compile errors by introducing `// expect error` annotations in test files. The test runner now validates that expected errors occur on specific lines and that the compiler exits with code 1 when errors are present. The compiler's error output is enhanced to include line numbers in the format `[Line N] Error`, and the `Token` struct gains a `line` field to track token positions. The main entry point returns exit code 1 when compilation fails, enabling the test runner to verify error exit codes.
This commit is contained in:
Bob Nystrom
2013-10-28 14:12:39 +00:00
parent cde3490579
commit b69dfe3bd6
5 changed files with 75 additions and 25 deletions
+1
View File
@@ -0,0 +1 @@
io.write(notDefined) // expect error
+3
View File
@@ -0,0 +1,3 @@
{
io.write(notDefined) // expect error
}