lang: funcs: structs: Core function struct modifications

These changes are needed for the lambdas implementation.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
This commit is contained in:
James Shubin
2023-09-25 17:14:21 -04:00
parent b4a8d0d783
commit a1a23b66c8
7 changed files with 446 additions and 424 deletions

View File

@@ -32,7 +32,8 @@ const (
// ConstFunc is a function that returns the constant value passed to Value.
type ConstFunc struct {
Value types.Value
Value types.Value
NameHint string
init *interfaces.Init
}
@@ -40,7 +41,12 @@ type ConstFunc struct {
// String returns a simple name for this function. This is needed so this struct
// can satisfy the pgraph.Vertex interface.
func (obj *ConstFunc) String() string {
if obj.NameHint != "" {
return obj.NameHint
}
return ConstFuncName
//return fmt.Sprintf("%s: %s(%s)", ConstFuncName, obj.Value.Type().String(), obj.Value.String())
//return fmt.Sprintf("%s(%s)", obj.Value.Type().String(), obj.Value.String())
}
// Validate makes sure we've built our struct properly.