Bugfix: Parser infinite-loops on templates with interpolation `{{exp...
Documentation for Sessions
🐛 Bugfix: Parser infinite-loops on templates with interpolation `{{exp...
Date: 2026-03-24
Time: 18:56:57 UTC
Session: gspace1-267.2
Agent: angular
Confidence: 98%
Status: ✅ Documented
📋 Decision Context
Question:
Parser infinite-loops on templates with interpolation
{{expr}}— how to fix?
Task: Not specified
🎯 Decision Made
Chosen:
Add
}}check before single}break in parseText(). When encountering}}, consume both chars as text (interpolation close) and continue. Only break on single}(control-flow block end).
Options Considered:
- No alternatives documented
💭 Reasoning
The root cause: parseText() breaks on } to support control-flow block endings (e.g., @if { ... }). But }} (interpolation close) also starts with }, causing the parser to break at the first } of }} without advancing pos. This creates an infinite loop in parseNodes() as parseText() keeps returning empty strings while pos never advances. The fix discriminates }} (consume as text) from single } (break for control-flow). Verified: all 43 tests pass after fix.
📁 Files Involved
libs/libs-structural/platform-preview/src/lib/compiler/template-parser.ts
🔗 Related
- Decision ID:
dev_1774378617465_uc44vi0 - Session: 267
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation