new syntax to get items from collection: collection[index]. Supported collections are string, list and dict

This commit is contained in:
2024-05-24 22:51:01 +02:00
parent e5f63c3d9d
commit 03d4c192c2
9 changed files with 126 additions and 30 deletions
+3 -3
View File
@@ -83,12 +83,12 @@ func (list *ListType) indexDeepCmp(target any) (index int) {
// -------- list term
func newListTermA(args ...*term) *term {
return newListTerm(args)
return newListTerm(0, 0, args)
}
func newListTerm(args []*term) *term {
func newListTerm(row, col int, args []*term) *term {
return &term{
tk: *NewValueToken(0, 0, SymList, "[]", args),
tk: *NewValueToken(row, col, SymList, "[]", args),
parent: nil,
children: nil,
position: posLeaf,