Skip to content

Commit

Permalink
inline make_eval_blang
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg committed Jul 26, 2021
1 parent 30d5c58 commit cec0a70
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/dune_rules/expander.ml
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,6 @@ module With_deps_if_necessary = struct
Value.to_string v ~dir:(Path.build t.dir)
end

let make_eval_blang ~f ~dir = function
| Blang.Const x -> Memo.Build.return x (* common case *)
| blang -> Blang.eval blang ~dir:(Path.build dir) ~f

module With_reduced_var_set = struct
open Memo.Build.O

Expand Down Expand Up @@ -737,9 +733,9 @@ module With_reduced_var_set = struct
~f:(expand_pform_opt ~context ~bindings:Pform.Map.empty ~dir)

let eval_blang ~context ~dir blang =
make_eval_blang
Blang.eval
~f:(expand_pform ~context ~bindings:Pform.Map.empty ~dir)
~dir blang
~dir:(Path.build dir) blang
end

let expand_and_eval_set t set ~standard =
Expand All @@ -754,6 +750,6 @@ let expand_and_eval_set t set ~standard =
s)

let eval_blang t blang =
make_eval_blang ~f:(No_deps.expand_pform t) ~dir:t.dir blang
Blang.eval ~f:(No_deps.expand_pform t) ~dir:(Path.build t.dir) blang

let find_package t pkg = t.find_package pkg

0 comments on commit cec0a70

Please sign in to comment.