[PR #330] [MERGED] Fix variable matching in twig grammar to ignore ${var} format #252

Closed
opened 2025-12-29 07:20:04 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/330
Author: @gschier
Created: 12/25/2025
Status: Merged
Merged: 12/28/2025
Merged by: @gschier

Base: mainHead: claude/fix-importer-variable-matching-A0wWS


📝 Commits (2)

  • 3f0815f Fix variable matching in twig grammar to ignore ${var} format
  • 992558e Add tests for twig grammar variable matching

📊 Changes

4 files changed (+121 additions, -16 deletions)

View changed files

📝 src-web/components/core/Editor/twig/twig.grammar (+1 -1)
📝 src-web/components/core/Editor/twig/twig.terms.ts (+3 -2)
src-web/components/core/Editor/twig/twig.test.ts (+106 -0)
📝 src-web/components/core/Editor/twig/twig.ts (+11 -13)

📄 Description

https://feedback.yaak.app/p/bug-report-incorrect-variable-recognition-and-json-formatting-issues

The Text token in the lezer grammar did not handle the case where
${ was followed by something other than [. This caused ${var}
(without square brackets) to be incorrectly parsed/recognized as
a template tag, when only ${[var]} should be recognized.

Added a third case to the Text token rule to handle ${ followed
by any character that is NOT [, treating it as regular text.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/330 **Author:** [@gschier](https://github.com/gschier) **Created:** 12/25/2025 **Status:** ✅ Merged **Merged:** 12/28/2025 **Merged by:** [@gschier](https://github.com/gschier) **Base:** `main` ← **Head:** `claude/fix-importer-variable-matching-A0wWS` --- ### 📝 Commits (2) - [`3f0815f`](https://github.com/mountain-loop/yaak/commit/3f0815f8d1574f6e8279840b1cd3ee0f87e06905) Fix variable matching in twig grammar to ignore ${var} format - [`992558e`](https://github.com/mountain-loop/yaak/commit/992558e8dc85f02fee60518c7b36e7e0ed441c10) Add tests for twig grammar variable matching ### 📊 Changes **4 files changed** (+121 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src-web/components/core/Editor/twig/twig.grammar` (+1 -1) 📝 `src-web/components/core/Editor/twig/twig.terms.ts` (+3 -2) ➕ `src-web/components/core/Editor/twig/twig.test.ts` (+106 -0) 📝 `src-web/components/core/Editor/twig/twig.ts` (+11 -13) </details> ### 📄 Description https://feedback.yaak.app/p/bug-report-incorrect-variable-recognition-and-json-formatting-issues The Text token in the lezer grammar did not handle the case where ${ was followed by something other than [. This caused ${var} (without square brackets) to be incorrectly parsed/recognized as a template tag, when only ${[var]} should be recognized. Added a third case to the Text token rule to handle ${ followed by any character that is NOT [, treating it as regular text. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 07:20:04 +01:00
adam closed this issue 2025-12-29 07:20:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/yaak#252