Skip to content

fix(parser): keep parenthesized multi-param lambda as first function arg - #2455

Open
lisbon-craigb-13142 wants to merge 2 commits into
JSQLParser:masterfrom
lisbon-craigb-13142:fix/lambda-first-arg-2195
Open

fix(parser): keep parenthesized multi-param lambda as first function arg#2455
lisbon-craigb-13142 wants to merge 2 commits into
JSQLParser:masterfrom
lisbon-craigb-13142:fix/lambda-first-arg-2195

Conversation

@lisbon-craigb-13142

Copy link
Copy Markdown

Summary

array_map((x,y,z) -> x + y, …) incorrectly kept only the parameter list (x, y, z) as the first argument. Tokens for -> body were consumed, then discarded by an unconditional reassignment after ParenthesedExpressionList().

Changes

  • In PrimaryExpression(), make the lambda branch and the plain-list assignment mutually exclusive.
  • Add regression test testLambdaFirstArgumentIssue2195.

Test plan

  • mvn -Dtest=LambdaExpressionTest test

Fixes #2195

Signed-off-by: lisbon-craigb-13142 <lisbon-craigb-13142@users.noreply.github.com>
Signed-off-by: lisbon-craigb-13142 <lisbon-craigb-13142@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSQLParser 5.1: LambdaExpression parameters error

1 participant