androidmk: support translating all-java-files-under

Change-Id: I4c343f6d8d23d42dddc256ff022016b595bb3841
This commit is contained in:
Colin Cross
2015-04-03 16:51:45 -07:00
parent 2fe6687847
commit 16daa921e3
4 changed files with 62 additions and 32 deletions

View File

@@ -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))
}