diff options
Diffstat (limited to 'androidmk/parser')
-rw-r--r-- | androidmk/parser/scope.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/androidmk/parser/scope.go b/androidmk/parser/scope.go index 742ad388..5e94ea58 100644 --- a/androidmk/parser/scope.go +++ b/androidmk/parser/scope.go @@ -58,7 +58,7 @@ func init() { builtinScope["__builtin_dollar"] = "$" } -func (v Variable) Value(scope Scope) string { +func (v Variable) EvalFunction(scope Scope) (string, bool) { f := v.Name.SplitN(" \t", 2) if len(f) > 1 && f[0].Const() { fname := f[0].Value(nil) @@ -70,13 +70,20 @@ func (v Variable) Value(scope Scope) string { } if fname == "call" { - return scope.Call(argVals[0], argVals[1:]) + return scope.Call(argVals[0], argVals[1:]), true } else { - return "__builtin_func:" + fname + " " + strings.Join(argVals, " ") + return "__builtin_func:" + fname + " " + strings.Join(argVals, " "), true } } } + return "", false +} + +func (v Variable) Value(scope Scope) string { + if ret, ok := v.EvalFunction(scope); ok { + return ret + } return scope.Get(v.Name.Value(scope)) } |