Add source location tracking to AST nodes
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
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// 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
|
||||
Reference in New Issue
Block a user