Skip to content

Fix template parsing for nested parentheses#218

Open
ziodave wants to merge 1 commit intoRMLio:developmentfrom
ziodave:development
Open

Fix template parsing for nested parentheses#218
ziodave wants to merge 1 commit intoRMLio:developmentfrom
ziodave:development

Conversation

@ziodave
Copy link
Copy Markdown

@ziodave ziodave commented Feb 2, 2026

Issue:
#217

Summary:
This PR replaces the regex-based $(...) parsing with a balanced‑parentheses parser that preserves nested parentheses (e.g., XPath contains(...)) while still handling quotes and escaped brackets. It also applies
the same logic in the expander’s template parsing for watched properties.

What changed:

  • Added a balanced template parser in lib/abstract-generator.js, with quote/escape handling and a fallback path for legacy escaped bracket cases.
  • Mirrored parsing logic in lib/expander.js for consistency.
  • Added a regression test fixture for XPath contains() in test/xpath-contains-template/ and a corresponding test case in lib/rml-generator.test.js.

Tests:

  • npm test

Disclosure:
This PR was written by Codex (AI assistant).

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.

1 participant