diff --git a/src/lib/eval.ml b/src/lib/eval.ml index a0c305c..fae6e72 100644 --- a/src/lib/eval.ml +++ b/src/lib/eval.ml @@ -339,6 +339,8 @@ module Make (S : Types.State) (Fd : Types.Fd) (E : Types.Exec) = struct let get_env ?(extra : (string * Ast.fragments) list Stack.t = Stack.empty) ctx = + (* TODO: This is a bit rickety, needs some thought as to the ordering of variables + and the scoping.*) let extra = Stack.to_list extra in let env = S.exports ctx.state |> List.map (fun (k, v) -> arg_equals_fast k v) @@ -348,7 +350,7 @@ module Make (S : Types.State) (Fd : Types.Fd) (E : Types.Exec) = struct (fun (k, v) -> arg_equals_fast k @@ Ast.Fragment.join_list ~sep:"" v) (List.concat extra) in - List.append extra env |> Array.of_list + List.append env extra |> Array.of_list let update ?export ?readonly ?local ctx ~param v = match S.update ?export ?readonly ?local ctx.state ~param v with