The commit expands the source location tracking through the AST by: 1. Switching from raw Expr/Stmt nodes to AstNode wrappers containing source slices 2. Updating interpreter and parser to preserve location info through node traversal 3. Enhancing error reporting with richer source context information
10 lines
260 B
Lox
10 lines
260 B
Lox
// Test script to verify error positioning
|
|
var a = 5;
|
|
var b = "hello";
|
|
print 0;
|
|
var result = a + b; // This should cause a type error
|
|
print 1;
|
|
43 + "hello"; // This should cause a type error
|
|
print result;
|
|
print 46 + "world"; // This should cause a type error
|