diff options
-rw-r--r-- | build2/parser.cxx | 5 | ||||
-rw-r--r-- | unit-tests/function/syntax.test | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx index a5ed0d5..412b557 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -2793,7 +2793,10 @@ namespace build2 // tt = peek (); - if (tt == type::lparen) + // Note that we require function call opening paren to be + // unseparated; consider: $x ($x == 'foo' ? 'FOO' : 'BAR'). + // + if (tt == type::lparen && !peeked ().separated) { // Function call. // diff --git a/unit-tests/function/syntax.test b/unit-tests/function/syntax.test index 0e4462e..bce00e7 100644 --- a/unit-tests/function/syntax.test +++ b/unit-tests/function/syntax.test @@ -4,14 +4,12 @@ $* <'$dump()' >:'' : none $* <'$dump( )' >:'' : none-in-spaces -$* <'$dump ()' >:'' : none-out-spaces $* <'$dump("")' >'{}' : one-empty $* <'$dump(a)' >'a' : one-single $* <'$dump(a b c)' >'a b c' : one-list $* <'$dump(d/t{x y z})' >'d/t{x} d/t{y} d/t{z}' : one-names -$* <'print a$dummy1 ([string] b)c' >'abc' : concat - +$* <'print a$dummy1([string] b)c' >'abc' : concat $* <'print $dummy2([uint64] 123, [uint64] 321)' >'444' : multi-arg : quoting |