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:
@@ -0,0 +1 @@
|
||||
io.write(notDefined) // expect error
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
io.write(notDefined) // expect error
|
||||
}
|
||||
Reference in New Issue
Block a user