Partially implement $(origin)
diff --git a/ast.go b/ast.go
index b8ee55c..8689b70 100644
--- a/ast.go
+++ b/ast.go
@@ -26,14 +26,13 @@
func (ast *AssignAST) evalRHS(ev *Evaluator, lhs string) Var {
switch ast.op {
case ":=":
- // TODO: origin
- return SimpleVar{value: ev.evalExpr(ast.rhs)}
+ return SimpleVar{value: ev.evalExpr(ast.rhs), origin: "file"}
case "=":
- return RecursiveVar{expr: ast.rhs}
+ return RecursiveVar{expr: ast.rhs, origin: "file"}
case "+=":
prev := ev.LookupVar(lhs)
if !prev.IsDefined() {
- return RecursiveVar{expr: ast.rhs}
+ return RecursiveVar{expr: ast.rhs, origin: "file"}
}
return prev.Append(ev, ast.rhs)
case "?=":
@@ -41,7 +40,7 @@
if prev.IsDefined() {
return prev
}
- return RecursiveVar{expr: ast.rhs}
+ return RecursiveVar{expr: ast.rhs, origin: "file"}
default:
panic(fmt.Sprintf("unknown assign op: %q", ast.op))
}