Commit a5015c10 authored by bguillaum's avatar bguillaum

fix #13765 (more robust parameter file loading)

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@6783 7838e531-6607-4d57-9587-6c381814729c
parent 928b874a
......@@ -88,7 +88,7 @@ module File = struct
try
while true do
let line = input_line in_ch in
if (Str.string_match (Str.regexp "^$[ \t]*") line 0) || (line.[0] = '%')
if (Str.string_match (Str.regexp "^[ \t]*$") line 0) || (line.[0] = '%')
then ()
else rev_lines := line :: !rev_lines
done; assert false
......@@ -97,7 +97,6 @@ module File = struct
List.rev !rev_lines
end
module Array_ = struct
let dicho_mem elt array =
let rec loop low high =
......@@ -500,12 +499,17 @@ module Lex_par = struct
type t = item list
let rm_peripheral_white s =
Str.global_replace (Str.regexp "\\( \\|\t\\)*$") ""
(Str.global_replace (Str.regexp "^\\( \\|\t\\)*") "" s)
let load ?loc nb_p nb_c file =
try
let lines = File.read file in
let param =
(List.map
(fun line ->
let line = rm_peripheral_white line in
match Str.split (Str.regexp "##") line with
| [args] when nb_c = 0 ->
(match Str.split (Str.regexp "#") args with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment