// Copyright (c) 2024-2026 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.

// operator-ctrl.go
package expr

import (
	"git.portale-stac.it/go-pkg/expr/kern"
	"git.portale-stac.it/go-pkg/expr/scan"
	"git.portale-stac.it/go-pkg/expr/sym"
)

//-------- export all term

func newExportAllTerm(tk *scan.Token) (inst *scan.Term) {
	return &scan.Term{
		Tk:       *tk,
		Children: nil,
		Position: scan.PosLeaf,
		Priority: scan.PriValue,
		EvalFunc: evalExportAll,
	}
}

func evalExportAll(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
	CtrlEnable(ctx, kern.ControlExportAll)
	return
}

// init
func init() {
	scan.RegisterTermConstructor(sym.SymDoubleAt, newExportAllTerm)
}
