linked-list supports index assign and concatenation
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"git.portale-stac.it/go-pkg/expr/types/dict"
|
||||
"git.portale-stac.it/go-pkg/expr/types/float"
|
||||
"git.portale-stac.it/go-pkg/expr/types/fract"
|
||||
"git.portale-stac.it/go-pkg/expr/types/list"
|
||||
"git.portale-stac.it/go-pkg/expr/types/str"
|
||||
)
|
||||
|
||||
@@ -50,6 +51,12 @@ func sumValues(plusTerm *scan.Term, leftValue, rightValue any) (v any, err error
|
||||
sumList = append(sumList, *leftList...)
|
||||
sumList = append(sumList, *rightList...)
|
||||
v = &sumList
|
||||
} else if list.IsLinkedList(leftValue) && list.IsLinkedList(rightValue) {
|
||||
lsLeft := leftValue.(*list.LinkedList)
|
||||
lsRight := rightValue.(*list.LinkedList)
|
||||
ls := lsLeft.Clone()
|
||||
ls.SeqPushBack(NewLinkedListIterator(lsRight, nil))
|
||||
v = ls
|
||||
} else if (fract.IsFraction(leftValue) && types.IsNumber(rightValue)) || (fract.IsFraction(rightValue) && types.IsNumber(leftValue)) {
|
||||
if float.IsFloat(leftValue) || float.IsFloat(rightValue) {
|
||||
v = types.NumAsFloat(leftValue) + types.NumAsFloat(rightValue)
|
||||
|
||||
Reference in New Issue
Block a user