completed list-type to array-type conversion and fixed common test module
This commit is contained in:
+4
-3
@@ -41,7 +41,7 @@ func sumValues(plusTerm *scan.Term, leftValue, rightValue any) (v any, err error
|
||||
rightInt, _ := rightValue.(int64)
|
||||
v = leftInt + rightInt
|
||||
}
|
||||
} else if array.IsList(leftValue) && array.IsList(rightValue) {
|
||||
} else if array.IsArray(leftValue) && array.IsArray(rightValue) {
|
||||
var leftList, rightList *array.ArrayType
|
||||
leftList, _ = leftValue.(*array.ArrayType)
|
||||
rightList, _ = rightValue.(*array.ArrayType)
|
||||
@@ -59,7 +59,8 @@ func sumValues(plusTerm *scan.Term, leftValue, rightValue any) (v any, err error
|
||||
} else if dict.IsDict(leftValue) && dict.IsDict(rightValue) {
|
||||
leftDict, _ := leftValue.(*dict.DictType)
|
||||
rightDict, _ := rightValue.(*dict.DictType)
|
||||
c := leftDict.Clone()
|
||||
clone := leftDict.Clone()
|
||||
c := clone.(*dict.DictType)
|
||||
c.Merge(rightDict)
|
||||
v = c
|
||||
} else if fract.IsFraction(leftValue) && fract.IsFraction(rightValue) {
|
||||
@@ -103,7 +104,7 @@ func diffValues(minusTerm *scan.Term, leftValue, rightValue any) (v any, err err
|
||||
rightInt, _ := rightValue.(int64)
|
||||
v = leftInt - rightInt
|
||||
}
|
||||
} else if array.IsList(leftValue) && array.IsList(rightValue) {
|
||||
} else if array.IsArray(leftValue) && array.IsArray(rightValue) {
|
||||
leftList, _ := leftValue.(*array.ArrayType)
|
||||
rightList, _ := rightValue.(*array.ArrayType)
|
||||
diffList := make(array.ArrayType, 0, len(*leftList)-len(*rightList))
|
||||
|
||||
Reference in New Issue
Block a user