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

// operator-but.go
package expr

//-------- but term

func newButTerm(tk *Token) (inst *term) {
	return &term{
		tk:       *tk,
		children: make([]*term, 0, 2),
		position: posInfix,
		priority: priBut,
		evalFunc: evalBut,
	}
}

func evalBut(ctx ExprContext, self *term) (v any, err error) {
	_, v, err = self.evalInfix(ctx)
	return
}

// init
func init() {
	registerTermConstructor(SymKwBut, newButTerm)
}