new syntax to get items from collection: collection[index]. Supported collections are string, list and dict
This commit is contained in:
@@ -38,23 +38,6 @@ func evalPlus(ctx ExprContext, self *term) (v any, err error) {
|
||||
rightInt, _ := rightValue.(int64)
|
||||
v = leftInt + rightInt
|
||||
}
|
||||
// } else if IsList(leftValue) || IsList(rightValue) {
|
||||
// var leftList, rightList *ListType
|
||||
// var ok bool
|
||||
// if leftList, ok = leftValue.(*ListType); !ok {
|
||||
// leftList = &ListType{leftValue}
|
||||
// }
|
||||
// if rightList, ok = rightValue.(*ListType); !ok {
|
||||
// rightList = &ListType{rightValue}
|
||||
// }
|
||||
// sumList := make(ListType, 0, len(*leftList)+len(*rightList))
|
||||
// for _, item := range *leftList {
|
||||
// sumList = append(sumList, item)
|
||||
// }
|
||||
// for _, item := range *rightList {
|
||||
// sumList = append(sumList, item)
|
||||
// }
|
||||
// v = &sumList
|
||||
} else if IsList(leftValue) && IsList(rightValue) {
|
||||
var leftList, rightList *ListType
|
||||
leftList, _ = leftValue.(*ListType)
|
||||
|
||||
Reference in New Issue
Block a user