alias operators: '<<' same as '<+', '>>' same as '+>'. Insert and append operation optimized with linked lists

This commit is contained in:
2026-05-16 17:18:23 +02:00
parent 3a4e217891
commit e6844ad1e8
7 changed files with 386 additions and 34 deletions
+6 -2
View File
@@ -39,7 +39,9 @@ func evalRightShift(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error)
return
}
v, err = bitRightShift(opTerm, leftValue, rightValue)
if v, err = bitRightShift(opTerm, leftValue, rightValue); err != nil {
v, err = prependToList(ctx, opTerm, leftValue, rightValue)
}
return
}
@@ -71,7 +73,9 @@ func evalLeftShift(ctx kern.ExprContext, opTerm *scan.Term) (v any, err error) {
return
}
v, err = bitLeftShift(opTerm, leftValue, rightValue)
if v, err = bitLeftShift(opTerm, leftValue, rightValue); err != nil {
v, err = appendToList(ctx, opTerm, leftValue, rightValue)
}
return
}