aboutsummaryrefslogtreecommitdiff
path: root/expr_test.go
diff options
context:
space:
mode:
authorFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-04-19 00:02:32 +0900
committerFumitoshi Ukai <fumitoshi.ukai@gmail.com>2015-04-19 00:04:30 +0900
commitf0a2ba7514a3feb2a7ac8b2c981696a183c5db34 (patch)
tree956dd5131855f029f730f95fcf12cadd62c3a0eb /expr_test.go
parent96c79f1ce0b44ce30f09b2b1b2ed9ebad2285d9a (diff)
downloadkati-f0a2ba7514a3feb2a7ac8b2c981696a183c5db34.tar.gz
add paramref for fast path for param access (e.g. $1, $(1))
still set "1" in Vars, for access like n := 1 v := $($(n)) fix to set $0 to variable name in $(call ) after: % ./run_integration_test.rb android Running make for android... 5.62 secs Running kati for android... 10.89 secs android: OK PASS!
Diffstat (limited to 'expr_test.go')
-rw-r--r--expr_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/expr_test.go b/expr_test.go
index d12e48d..acb51c0 100644
--- a/expr_test.go
+++ b/expr_test.go
@@ -236,6 +236,28 @@ func TestParseExpr(t *testing.T) {
},
},
},
+ {
+ in: `$(strip $1)`,
+ val: &funcStrip{
+ fclosure: fclosure{
+ args: []Value{
+ literal("(strip"),
+ paramref(1),
+ },
+ },
+ },
+ },
+ {
+ in: `$(strip $(1))`,
+ val: &funcStrip{
+ fclosure: fclosure{
+ args: []Value{
+ literal("(strip"),
+ paramref(1),
+ },
+ },
+ },
+ },
} {
val, _, err := parseExpr([]byte(tc.in), nil)
if tc.isErr {