]> matita.cs.unibo.it Git - helm.git/commitdiff
Changed mapping keys <-> environment variables, mixed case envvars are
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 20 May 2004 16:30:32 +0000 (16:30 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Thu, 20 May 2004 16:30:32 +0000 (16:30 +0000)
now used.

helm/ocaml/registry/helm_registry.ml
helm/ocaml/registry/helm_registry.mli

index 10639e0899d82a6daf702f8623bb2dec5743e931..a5e1d6e1ac167528d2405f799af8c04e76e9400c 100644 (file)
@@ -86,9 +86,8 @@ let restore_registry backup =
 
   (* as \\w but:
    * - no sequences of '_' longer than 1 are permitted
-   * - no uppercase letter are permitted
    *)
-let valid_step_rex_raw = "[a-z0-9]+\\(_[a-z0-9]+\\)*"
+let valid_step_rex_raw = "[a-zA-Z0-9]+\\(_[a-z0A-Z-9]+\\)*"
 let valid_key_rex_raw =
   sprintf "%s\(\\.%s\)*" valid_step_rex_raw valid_step_rex_raw
 let valid_key_rex = Str.regexp ("^" ^ valid_key_rex_raw ^ "$")
@@ -127,8 +126,7 @@ let set' registry ~key ~value =
 
 let unset = Hashtbl.remove registry
 
-let env_var_of_key key =
-  Str.global_replace dot_rex "__" (String.uppercase key)
+let env_var_of_key = Str.global_replace dot_rex "__"
 
 let get key =
   let rec aux stack key =
index 7b7ef874fdc1eec49b71d4a8ff4ccad46a1b646e..0f13a6162b55c23a606266736d72658eda983dc8 100644 (file)
@@ -29,7 +29,7 @@
  *
  *  key ::= path
  *  path ::= component ( '.' component )*
- *  component ::= ( lowercase_alpha | num | '_' )+
+ *  component ::= ( alpha | num | '_' )+
  *  # with the only exception that sequences of '_' longer than 1 aren't valid
  *  # components
  *
@@ -51,9 +51,8 @@
  *  a configuration file (via "save_to" function below) .
  *
  *  Mapping between keys and environment variables is as follows:
- *  - the whole key is uppercased
  *  - each "." is converted to "__"
- *  E.g.: my.foo_ish.application -> MY__FOO_ISH__APPLICATION
+ *  E.g.: my.Foo_iSH.Application -> my__Foo_iSH__Application
  *
  * ++ Variable interpolation ++
  *