Fixed bug involving what was being set
All checks were successful
Test / build (push) Successful in 56s

This commit is contained in:
Leon Mika 2025-05-18 07:27:57 +10:00
parent 51e35aa9a6
commit 33d04ba18d

View file

@ -79,7 +79,7 @@ func (e evaluator) evalCmd(ctx context.Context, ec *evalCtx, currentPipe Object,
return nil, err
}
return e.assignDot(ctx, ec, ast.Assign, assignVal)
return e.assignDot(ctx, ec, ast.Name, assignVal)
case (ast.Name.Arg.Ident != nil) && len(ast.Name.DotSuffix) == 0:
name := ast.Name.Arg.Ident.String()
@ -184,12 +184,12 @@ func (e evaluator) evalDot(ctx context.Context, ec *evalCtx, n astDot) (Object,
return res, nil
}
func (e evaluator) assignDot(ctx context.Context, ec *evalCtx, n *astDot, toVal Object) (Object, error) {
func (e evaluator) assignDot(ctx context.Context, ec *evalCtx, n astDot, toVal Object) (Object, error) {
if len(n.DotSuffix) == 0 {
return e.assignArg(ctx, ec, n.Arg, toVal)
}
panic("TODO")
return nil, errors.New("TODO")
}
func (e evaluator) evalArg(ctx context.Context, ec *evalCtx, n astCmdArg) (Object, error) {