diff --git a/zcl/json/structure.go b/zcl/json/structure.go index 6ad28ab..0b39861 100644 --- a/zcl/json/structure.go +++ b/zcl/json/structure.go @@ -259,3 +259,11 @@ func (e *expression) Value(ctx *zcl.EvalContext) (cty.Value, zcl.Diagnostics) { return cty.DynamicVal, nil } } + +func (e *expression) Range() zcl.Range { + return e.src.Range() +} + +func (e *expression) StartRange() zcl.Range { + return e.src.StartRange() +} diff --git a/zcl/structure.go b/zcl/structure.go index 877b33d..96a9857 100644 --- a/zcl/structure.go +++ b/zcl/structure.go @@ -101,6 +101,9 @@ type Expression interface { // the specific symbol in question. Value(ctx *EvalContext) (cty.Value, Diagnostics) + Range() Range + StartRange() Range + // TODO: A "Variables" method that returns a description of all of the // variables used in the expression, so callers can populate the scope // only with variables that are actually used.