mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-14 07:43:25 +01:00
[PR #330] [MERGED] Fix variable matching in twig grammar to ignore ${var} format #254
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
main← Head:claude/fix-importer-variable-matching-A0wWS📝 Commits (2)
3f0815fFix variable matching in twig grammar to ignore ${var} format992558eAdd 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.