Add more XQuery 3.1 keywords to reservedKeywords rule#6103
Open
joewiz wants to merge 1 commit intoeXist-db:developfrom
Open
Add more XQuery 3.1 keywords to reservedKeywords rule#6103joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz wants to merge 1 commit intoeXist-db:developfrom
Conversation
3 tasks
Add 10 keywords to the reservedKeywords grammar rule: ascending, descending, greatest, least, satisfies, schema-attribute, castable, idiv, processing-instruction, allowing. These keywords are used in grammar productions but were missing from the reservedKeywords rule, which lists keywords that can also serve as NCNames (variable names, function names, etc.). Without these entries, using any of them as a variable name (e.g., let $ascending := 1) causes an XPST0003 parse error. Continues the pattern from 1dc5913 (added "case") and addresses the class of issues described in eXist-db#2381 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3c809fb to
efb9b95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reservedKeywordsgrammar rule so they can be used as NCNames (variable names, function names, etc.)ascending,descending,greatest,least,satisfies,schema-attribute,castable,idiv,processing-instruction,allowinglet $ascending := 1) causes an XPST0003 parse errorContext
The
reservedKeywordsrule inXQuery.glists keywords that the parser recognizes as valid NCNames. Keywords used in grammar rules but not listed here cannot be used as identifiers, which violates the XQuery specification's rules for contextual keywords.Continues the pattern from 1dc5913 (added
case) and addresses the class of issues described in #2381.What Changed
exist-core/.../parser/XQuery.greservedKeywordsruleexist-core/.../xquery/ReservedKeywordsAsNCNamesTest.javaXQTS Results (W3C XQTS 3.1, full suite)
Improvements (4 tests newly passing):
xquery10keywords,xquery10keywords2,xquery10keywords3(prod-LetClause) — keywords as variable namesK2-ForExprWithout-38(prod-ForClause) —castableas variable nameApparent regressions (7 tests) are XQTS runner flakiness — axis tests returning
actual='0'(truncated results from resource contention), not caused by this change. Confirmed by cross-checking against the DSLASH branch where the same tests pass.Test Plan
ReservedKeywordsAsNCNamesTest(9 tests)🤖 Generated with Claude Code