let string_tail s =
let len = String.length s in
String.sub s 1 (len-1)
+let nonvar s =
+ let len = String.length s in
+ let suffix = String.sub s (len-4) 4 in
+ not (suffix = ".var")
let add_param_substs params =
List.map
List.map int_of_string (Pcre.split ~pat:" " choices) in
let parse_choices choices_raw =
let choices = Pcre.split ~pat:";" choices_raw in
- List.fold_left
- (fun f x ->
- match Pcre.split ~pat:"\\s" x with
- | ""::id::tail
- | id::tail when id<>"" ->
- (fun id' ->
- if id = id' then
- Some (List.map (fun u -> Netencoding.Url.decode u) tail)
- else
- f id')
- | _ -> failwith "Can't parse choices")
- (fun _ -> None)
- choices
+ List.fold_left
+ (fun f x ->
+ match Pcre.split ~pat:"\\s" x with
+ | ""::id::tail
+ | id::tail when id<>"" ->
+ (fun id' ->
+ if id = id' then
+ Some (List.map (fun u -> Netencoding.Url.decode u) tail)
+ else
+ f id')
+ | _ -> failwith "Can't parse choices")
+ (fun _ -> None)
+ choices
in
let id_to_uris = CicTextualParser2.EnvironmentP3.of_string id_to_uris_raw in
let id_to_choices =
=
match id_to_choices id with
| Some choices -> choices
- | None -> assert false
+ | None -> List.filter nonvar choices
let interactive_interpretation_choice interpretations =
match interpretation_choices with