new operator 'groupby'
This commit is contained in:
+7
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user