term.go: two error messages corrected

This commit is contained in:
Celestino Amoroso 2024-12-23 06:53:37 +01:00
parent 406bced450
commit 76e01f12d2

View File

@ -62,8 +62,8 @@ func (s *term) Clone() (d *term) {
}
}
d = &term{
tk: *s.tk.Clone(),
parent: s.parent,
tk: *s.tk.Clone(),
parent: s.parent,
children: children,
position: s.position,
priority: s.priority,
@ -211,11 +211,11 @@ func (term *term) checkOperands() (err error) {
}
case posPrefix:
if term.children == nil || len(term.children) != 1 || term.children[0] == nil {
err = term.tk.Errorf("prefix operator %q requires one not nil operand", term.tk.String())
err = term.tk.Errorf("prefix operator %q requires one non-nil operand", term.tk.String())
}
case posPostfix:
if term.children == nil || len(term.children) != 1 || term.anyChildrenNil() {
err = term.tk.Errorf("postfix operator %q requires one not nil operand", term.tk.String())
err = term.tk.Errorf("postfix operator %q requires one non-nil operand", term.tk.String())
}
case posMultifix:
if term.children == nil || len(term.children) < 3 || term.anyChildrenNil() {