zclsyntax: stub of FunctionCallExpr
This was added mainly just to spin the wheels of the Variables method generator. Its implementation is not yet complete.
This commit is contained in:
parent
bae8f83298
commit
31caa36b9a
@ -65,3 +65,32 @@ func (e *ScopeTraversalExpr) Range() zcl.Range {
|
|||||||
func (e *ScopeTraversalExpr) StartRange() zcl.Range {
|
func (e *ScopeTraversalExpr) StartRange() zcl.Range {
|
||||||
return e.SrcRange
|
return e.SrcRange
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FunctionCallExpr is an Expression that calls a function from the EvalContext
|
||||||
|
// and returns its result.
|
||||||
|
type FunctionCallExpr struct {
|
||||||
|
Name string
|
||||||
|
Args []Expression
|
||||||
|
|
||||||
|
NameRange zcl.Range
|
||||||
|
OpenParenRange zcl.Range
|
||||||
|
CloseParenRange zcl.Range
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *FunctionCallExpr) walkChildNodes(w internalWalkFunc) {
|
||||||
|
for i, arg := range e.Args {
|
||||||
|
e.Args[i] = w(arg).(Expression)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *FunctionCallExpr) Value(ctx *zcl.EvalContext) (cty.Value, zcl.Diagnostics) {
|
||||||
|
panic("FunctionCallExpr.Value not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *FunctionCallExpr) Range() zcl.Range {
|
||||||
|
return zcl.RangeBetween(e.NameRange, e.CloseParenRange)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *FunctionCallExpr) StartRange() zcl.Range {
|
||||||
|
return zcl.RangeBetween(e.NameRange, e.OpenParenRange)
|
||||||
|
}
|
||||||
|
@ -7,6 +7,10 @@ import (
|
|||||||
"github.com/apparentlymart/go-zcl/zcl"
|
"github.com/apparentlymart/go-zcl/zcl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (e *FunctionCallExpr) Variables() []zcl.Traversal {
|
||||||
|
return Variables(e)
|
||||||
|
}
|
||||||
|
|
||||||
func (e *LiteralValueExpr) Variables() []zcl.Traversal {
|
func (e *LiteralValueExpr) Variables() []zcl.Traversal {
|
||||||
return Variables(e)
|
return Variables(e)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user