lang: interpolate: Add temporary textarea info to interpolation

We should really be doing the math to find out how far along the string
each token really is, but that's complicated and tedious, especially
with the simplification passes, so let's skip that for now and just show
the whole thing.
This commit is contained in:
James Shubin
2025-06-06 02:46:41 -04:00
parent c2c6cb5b6a
commit 32e91dc7de

View File

@@ -94,12 +94,14 @@ func RagelInterpolate(str string, textarea *interfaces.Textarea, data *interface
switch t := term.(type) {
case Literal:
expr := &ast.ExprStr{
Textarea: *textarea, // XXX: until we re-calculate
V: t.Value,
}
exprs = append(exprs, expr)
case Variable:
expr := &ast.ExprVar{
Textarea: *textarea, // XXX: until we re-calculate
Name: t.Name,
}
exprs = append(exprs, expr)