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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user