lang: ast, interfaces, interpolate: Remove the legacy pos

This ports things to the new textarea. We need to plumb through things a
lot more, especially the string interpolation math to get the right
offsets everywhere, but that's coming.
This commit is contained in:
James Shubin
2025-06-06 00:58:30 -04:00
parent 86dfa5844a
commit cdc6743d83
4 changed files with 12 additions and 58 deletions

View File

@@ -7495,14 +7495,6 @@ func (obj *ExprStr) Init(data *interfaces.Data) error {
// which need interpolation. If any are found, it returns a larger AST which has
// a function which returns a string as its root. Otherwise it returns itself.
func (obj *ExprStr) Interpolate() (interfaces.Expr, error) {
pos := &interfaces.Pos{
// XXX: populate this?
// column/line number, starting at 1
//Column: -1, // TODO
//Line: -1, // TODO
//Filename: "", // optional source filename, if known
}
data := &interfaces.Data{
// TODO: add missing fields here if/when needed
Fs: obj.data.Fs,
@@ -7526,7 +7518,7 @@ func (obj *ExprStr) Interpolate() (interfaces.Expr, error) {
},
}
result, err := obj.data.StrInterpolater(obj.V, pos, data)
result, err := obj.data.StrInterpolater(obj.V, &obj.Textarea, data)
if err != nil {
return nil, err
}