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:


💭 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


🔗 Related


Auto-generated by MCP Smart Consolidation