Skip to content

Fix dataCategoryName: close parenthesized data category list with RPAREN - #142

Open
rickroesler wants to merge 1 commit into
apex-dev-tools:mainfrom
rickroesler:fix/data-category-name-rparen
Open

Fix dataCategoryName: close parenthesized data category list with RPAREN#142
rickroesler wants to merge 1 commit into
apex-dev-tools:mainfrom
rickroesler:fix/data-category-name-rparen

Conversation

@rickroesler

Copy link
Copy Markdown

Fixes #141

Change

One token in antlr/BaseApexParser.g4: the second alternative of dataCategoryName closed the parenthesized list with LPAREN instead of RPAREN, so valid multi-category WITH DATA CATEGORY filters failed to parse.

 dataCategoryName
     : soqlId
-    | LPAREN soqlId (COMMA soqlId)* LPAREN;
+    | LPAREN soqlId (COMMA soqlId)* RPAREN;

Tests

Added three regression tests to SOQLParserTest in both the npm and jvm targets, using the example queries verbatim from the Salesforce WITH DATA CATEGORY documentation: single category (ABOVE usa__c), parenthesized list (AT (usa__c, uk__c)), and AND-joined selections.

Verified fail-first: with the unmodified grammar, the parenthesized-list test fails with exactly one syntax error at the closing ); the other tests pass. With the fix: npm suite 96/96 (8 suites), jvm 94/94 via mvn package (SOQLParserTest 23/23).

Also added a ## Unreleased CHANGELOG entry following the convention from #125.

🤖 Generated with Claude Code

The second alternative of the dataCategoryName rule ended with LPAREN
instead of RPAREN, so valid multi-category filters such as
WITH DATA CATEGORY Geography__c ABOVE_OR_BELOW (usa__c, uk__c)
failed to parse. Adds regression tests to both npm and jvm targets
and a changelog entry.

Implemented by codex (gpt-5.6-sol); committed by orchestrator on its behalf.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.

dataCategoryName closes parenthesized data category list with LPAREN instead of RPAREN

1 participant