aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/azalea
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rosa/azalea')
-rw-r--r--internal/rosa/azalea/evaluate.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/internal/rosa/azalea/evaluate.go b/internal/rosa/azalea/evaluate.go
index b35a056a..cb5e8d12 100644
--- a/internal/rosa/azalea/evaluate.go
+++ b/internal/rosa/azalea/evaluate.go
@@ -200,12 +200,15 @@ func (e EvaluationError) Error() string {
}
var (
- // IdentInputs is a special array argument in a package declaration whose
+
+ // IdentTools is a special array argument in a package declaration whose
// values of [Ident] are kept as is when passed to a [PF].
+ IdentTools = unique.Make(Ident("tools"))
+ // IdentInputs has the same semantics as [IdentTools].
IdentInputs = unique.Make(Ident("inputs"))
- // IdentRuntime has the same semantics as [IdentInputs].
+ // IdentRuntime has the same semantics as [IdentTools].
IdentRuntime = unique.Make(Ident("runtime"))
- // IdentExtra has the same semantics as [IdentInputs].
+ // IdentExtra has the same semantics as [IdentTools].
IdentExtra = unique.Make(Ident("extra"))
// IdentSource is a special argument in a package declaration where an
// assignment of a [Val] with a single [Ident] passes through the evaluator.
@@ -356,6 +359,7 @@ func evaluateAny(d PF, s []Frame, expr, rp any) bool {
farg := FArg{R: arg.R}
if e.Package {
for _, special := range [...]unique.Handle[Ident]{
+ IdentTools,
IdentInputs,
IdentRuntime,
IdentExtra,
@@ -365,7 +369,13 @@ func evaluateAny(d PF, s []Frame, expr, rp any) bool {
panic(ErrInvalidSpecial)
}
farg.K = names[0]
- if err := storeE(&farg.V, arg.V[0]); err != nil {
+
+ v := arg.V[0]
+ if p, _ok := v.(Ident); _ok && p == "nil" {
+ v = Nil{}
+ }
+
+ if err := storeE(&farg.V, v); err != nil {
panic(err)
}
fargs = append(fargs, farg)