new operator dot '.' used to select an item or character from a list or a string respectively

This commit is contained in:
2024-04-19 09:05:26 +02:00
parent b76481bbf2
commit 7198749063
4 changed files with 71 additions and 9 deletions
+2 -1
View File
@@ -24,6 +24,7 @@ const (
priSign
priFact
priCoalesce
priDot
priValue
)
@@ -166,7 +167,7 @@ func (self *term) checkOperands() (err error) {
switch self.position {
case posInfix:
if self.children == nil || len(self.children) != 2 || self.anyChildrenNil() {
err = self.tk.Errorf("infix operator %q requires two not nil operands, got %d", self.source(), self.getChildrenCount())
err = self.tk.Errorf("infix operator %q requires two non-nil operands, got %d", self.source(), self.getChildrenCount())
}
case posPrefix:
if self.children == nil || len(self.children) != 1 || self.children[0] == nil {