diff --git a/source/parser.hera b/source/parser.hera index ab342be0..7df0c6d6 100644 --- a/source/parser.hera +++ b/source/parser.hera @@ -2425,7 +2425,7 @@ FunctionExpression children: [ open, fn, close ], expression: fn, } - OpenParen:open __:ws1 !/\+\+|--|[\+\-&]\S/ BinaryOp:op __:ws2 NonPipelineAssignmentExpression:rhs CloseParen:close -> + OpenParen:open __:ws1 !/\+\+|--|[\+\-&]\S/ !( Placeholder TypePostfix ) BinaryOp:op __:ws2 NonPipelineAssignmentExpression:rhs CloseParen:close -> const refA = makeRef("a") const fn = makeAmpersandFunction({ ref: refA, diff --git a/test/function-block-shorthand.civet b/test/function-block-shorthand.civet index 443d2ac0..2f1b4d0b 100644 --- a/test/function-block-shorthand.civet +++ b/test/function-block-shorthand.civet @@ -1105,3 +1105,11 @@ describe "operator sections", -> --- const callback = (b => sum += /*num*/b) """ + + testCase """ + & not left section + --- + (& as number) + 1 + --- + $ => ($ as number) + 1 + """