The name of 'list' has been changed to 'array'; from now on, 'list' will refer to the linked list.

This commit is contained in:
2026-07-12 07:35:28 +02:00
parent b6da9bcad4
commit 77f36642b4
37 changed files with 180 additions and 196 deletions
+6 -6
View File
@@ -46,7 +46,7 @@ func evalDeepCopyAssign(ctx kern.ExprContext, opTerm *scan.Term) (v any, err err
func assignCollectionItem(ctx kern.ExprContext, collectionTerm, keyListTerm *scan.Term, value any) (err error) {
var collectionValue, keyListValue, keyValue any
var keyList *array.ListType
var keyList *array.ArrayType
var ok bool
if collectionValue, err = collectionTerm.Compute(ctx); err != nil {
@@ -55,7 +55,7 @@ func assignCollectionItem(ctx kern.ExprContext, collectionTerm, keyListTerm *sca
if keyListValue, err = keyListTerm.Compute(ctx); err != nil {
return
} else if keyList, ok = keyListValue.(*array.ListType); !ok || len(*keyList) != 1 {
} else if keyList, ok = keyListValue.(*array.ArrayType); !ok || len(*keyList) != 1 {
err = keyListTerm.Errorf("index/key specification expected, got %v [%s]", keyListValue, kern.TypeName(keyListValue))
return
}
@@ -65,7 +65,7 @@ func assignCollectionItem(ctx kern.ExprContext, collectionTerm, keyListTerm *sca
}
switch collection := collectionValue.(type) {
case *array.ListType:
case *array.ArrayType:
if index, ok := keyValue.(int64); ok {
err = collection.SetItem(index, value)
} else {
@@ -180,7 +180,7 @@ func newOpAssignTerm(tk *scan.Token) (inst *scan.Term) {
func getCollectionItemValue(ctx kern.ExprContext, collectionTerm, keyListTerm *scan.Term) (value any, err error) {
var collectionValue, keyListValue, keyValue any
var keyList *array.ListType
var keyList *array.ArrayType
var ok bool
if collectionValue, err = collectionTerm.Compute(ctx); err != nil {
@@ -189,7 +189,7 @@ func getCollectionItemValue(ctx kern.ExprContext, collectionTerm, keyListTerm *s
if keyListValue, err = keyListTerm.Compute(ctx); err != nil {
return
} else if keyList, ok = keyListValue.(*array.ListType); !ok || len(*keyList) != 1 {
} else if keyList, ok = keyListValue.(*array.ArrayType); !ok || len(*keyList) != 1 {
err = keyListTerm.Errorf("index/key specification expected, got %v [%s]", keyListValue, kern.TypeName(keyListValue))
return
}
@@ -199,7 +199,7 @@ func getCollectionItemValue(ctx kern.ExprContext, collectionTerm, keyListTerm *s
}
switch collection := collectionValue.(type) {
case *array.ListType:
case *array.ArrayType:
if index, ok := keyValue.(int64); ok {
value = (*collection)[index]
} else {