Skip to content

A10 - Add ESCAPED_IDENTIFIER token to support backtick escaping#61

Merged
ruizmaa merged 3 commits into
cr-48/grammar-docs-consistencyfrom
a10
May 25, 2026
Merged

A10 - Add ESCAPED_IDENTIFIER token to support backtick escaping#61
ruizmaa merged 3 commits into
cr-48/grammar-docs-consistencyfrom
a10

Conversation

@ruizmaa
Copy link
Copy Markdown
Contributor

@ruizmaa ruizmaa commented May 19, 2026

closes #53

Summary

Adds backtick escaping so DPM-XL reserved words can be used as property names, temporary identifiers, and key names

  • Adds ESCAPED_IDENTIFIER lexer token in three modes: default, CLAUSE_MODE, and GROUPING_CLAUSE_MODE
  • Extends parser rules propertyCode, temporaryIdentifier, and keyNames to accept ESCAPED_IDENTIFIER
  • Strips backticks in the AST constructor so the resulting node is identical to the unescaped form
  • Regenerates all ANTLR parser files from the updated .g4 sources

Tests

New test file tests/unit/ast/test_escaped_identifier.py:

  • Valid forms across all three contexts are accepted
  • Backtick stripping produces the correct node
  • Malformed backtick expressions are rejected

Checklist

  • Code quality checks pass (ruff format, ruff check, mypy)
  • Tests pass (pytest) with 100% branch coverage (coverage report --fail-under=100)
  • Documentation updated (if applicable)

Impact / Risk

  • Breaking changes? (public API / CLI / REST endpoints / Django models)
  • Database schema or migration concerns?
  • Notes for release/changelog?

Notes

@ruizmaa ruizmaa self-assigned this May 19, 2026
@ruizmaa ruizmaa changed the base branch from master to cr-48/grammar-docs-consistency May 19, 2026 09:39
@ruizmaa ruizmaa marked this pull request as ready for review May 19, 2026 09:44
Copy link
Copy Markdown
Contributor

@javihern98 javihern98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! 😊

@ruizmaa ruizmaa merged commit 0287e64 into cr-48/grammar-docs-consistency May 25, 2026
18 checks passed
@ruizmaa ruizmaa deleted the a10 branch May 25, 2026 13:48
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.

A10 - Add ESCAPED_IDENTIFIER token to support backtick escaping

2 participants