new operator 'groupby'

This commit is contained in:
2026-05-02 14:46:28 +02:00
parent d5ced343c4
commit 3b2ef7927b
12 changed files with 271 additions and 58 deletions
+7 -2
View File
@@ -45,15 +45,20 @@ func evalDot(ctx kern.ExprContext, opTerm *term) (v any, err error) {
err = indexTerm.tk.ErrorExpectedGot("identifier")
}
case *kern.DictType:
var ok bool
s := opTerm.children[1].symbol()
if s == SymVariable || s == SymString {
src := opTerm.children[1].Source()
if len(src) > 1 && src[0] == '"' && src[len(src)-1] == '"' {
src = src[1 : len(src)-1]
}
v, err = unboxedValue.GetItem(src)
if v, ok = unboxedValue.GetItem(src); !ok {
err = opTerm.errKeyNotFound(src)
}
} else if rightValue, err = opTerm.children[1].Compute(ctx); err == nil {
v, err = unboxedValue.GetItem(rightValue)
if v, ok = unboxedValue.GetItem(rightValue); !ok {
err = opTerm.errKeyNotFound(rightValue)
}
}
default:
if rightValue, err = opTerm.children[1].Compute(ctx); err == nil {