From c724f161c52b7d0fa874b256392c15709b6e82df Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 9 Sep 2014 14:39:32 -0700 Subject: [PATCH] config: parse multi-args in interpolations [GH-282] --- CHANGELOG.md | 1 + config/expr.y | 4 ++-- config/expr_parse_test.go | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 424daec0af..dd6b0a81d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ BUG FIXES: * core: `-no-color` flag properly disables color. [GH-250] * core: "~" is expanded in `-var-file` flags. [GH-273] * core: Errors with tfvars are shown in console. [GH-269] + * core: Interpolation function calls with more than two args parse. [GH-282] * providers/aws: Refreshing EIP from pre-0.2 state file won't error. [GH-258] * providers/aws: Creating EIP without an instance/network won't fail. * providers/aws: Refreshing EIP manually deleted works. diff --git a/config/expr.y b/config/expr.y index 27903f714f..1c295cce6f 100644 --- a/config/expr.y +++ b/config/expr.y @@ -62,9 +62,9 @@ args: { $$ = nil } -| expr COMMA expr +| args COMMA expr { - $$ = append($$, $1, $3) + $$ = append($1, $3) } | expr { diff --git a/config/expr_parse_test.go b/config/expr_parse_test.go index da6ab0e432..a8d34d5534 100644 --- a/config/expr_parse_test.go +++ b/config/expr_parse_test.go @@ -88,6 +88,19 @@ func TestExprParse(t *testing.T) { }, false, }, + + { + `concat("foo","-","0.0/16")`, + &FunctionInterpolation{ + Func: nil, // Funcs["lookup"] + Args: []Interpolation{ + &LiteralInterpolation{Literal: "foo"}, + &LiteralInterpolation{Literal: "-"}, + &LiteralInterpolation{Literal: "0.0/16"}, + }, + }, + false, + }, } for i, tc := range cases {