Skip to content

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

Merged
manticore-projects merged 3 commits into
JSQLParser:masterfrom
ivanclarksoft:fix/lambda-first-arg-2195
Aug 10, 2026
Merged

fix(parser): keep parenthesized multi-param lambda as first function arg#2455
manticore-projects merged 3 commits into
JSQLParser:masterfrom
ivanclarksoft:fix/lambda-first-arg-2195

Conversation

@ivanclarksoft

Copy link
Copy Markdown
Contributor

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

lisbon-craigb-13142 added 2 commits August 8, 2026 14:47
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>
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you for your work and effort. Please run './gradlew spotlessApply' to fix all format violations and ./gradlew check before committing.

Signed-off-by: ivanclarksoft <ivanclarksoft@users.noreply.github.com>
@ivanclarksoft

Copy link
Copy Markdown
Contributor Author

Thanks for the review — I've run formatting for the Spotless violation in LambdaExpressionTest.java (long sqlStr wrap) and pushed to this branch. ./gradlew spotlessApply / ./gradlew check are what CI will re-run on the update; please take another look when convenient.

@manticore-projects
manticore-projects merged commit b444bc2 into JSQLParser:master Aug 10, 2026
7 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you for your work and effort!

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

2 participants