s/Env.get_var/Env.get/

This commit is contained in:
Rudi Grinberg 2018-03-11 11:17:09 +07:00
parent 206cc69fd9
commit 4b191b2b03
3 changed files with 5 additions and 5 deletions

View File

@ -251,7 +251,7 @@ let create ~(kind : Kind.t) ~path ~env_extra ~name ~merlin
&& version >= (4, 03, 0) && version >= (4, 03, 0)
&& version < (4, 05, 0) then && version < (4, 05, 0) then
let value = let value =
match Env.get_var env "OCAMLPARAM" with match Env.get env "OCAMLPARAM" with
| None -> "color=always,_" | None -> "color=always,_"
| Some s -> "color=always," ^ s | Some s -> "color=always," ^ s
in in
@ -274,7 +274,7 @@ let create ~(kind : Kind.t) ~path ~env_extra ~name ~merlin
; build_dir ; build_dir
; path ; path
; toplevel_path = ; toplevel_path =
Option.map (Env.get_var env "OCAML_TOPLEVEL_PATH") ~f:Path.absolute Option.map (Env.get env "OCAML_TOPLEVEL_PATH") ~f:Path.absolute
; ocaml_bin = dir ; ocaml_bin = dir
; ocaml = (match which "ocaml" with Some p -> p | None -> prog_not_found_in_path "ocaml") ; ocaml = (match which "ocaml" with Some p -> p | None -> prog_not_found_in_path "ocaml")
@ -422,7 +422,7 @@ let env_for_exec t =
let cwd = Sys.getcwd () in let cwd = Sys.getcwd () in
let extend_var var v = let extend_var var v =
let v = Filename.concat cwd (Path.to_string v) in let v = Filename.concat cwd (Path.to_string v) in
match Env.get_var t.env var with match Env.get t.env var with
| None -> (var, v) | None -> (var, v)
| Some prev -> (var, sprintf "%s%c%s" v sep prev) | Some prev -> (var, sprintf "%s%c%s" v sep prev)
in in

View File

@ -55,7 +55,7 @@ let get_env_base env var =
in in
loop 0 loop 0
let get_var t v = let get t v =
match Map.find t.extra v with match Map.find t.extra v with
| None -> get_env_base t.base v | None -> get_env_base t.base v
| Some _ as v -> v | Some _ as v -> v

View File

@ -13,6 +13,6 @@ val initial : unit -> t
val to_unix : t -> string array val to_unix : t -> string array
val get_var : t -> Var.t -> string option val get : t -> Var.t -> string option
val extend : t -> vars:string Map.t -> t val extend : t -> vars:string Map.t -> t