Commit 3009f412 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Fix a bug in gnuplot-rif (parenthesis in the preambule were pertubating...)

parent 7bfb021b
......@@ -72,7 +72,7 @@ let (readfile: string -> string) =
(********************************************************************************)
let lexer = make_lexer ["#"; "columns"; ":"; "|"; ]
let lexer = make_lexer ["#"; "columns"; ":"; "|"; ")";"("]
type tok = token Stream.t
let debug_parsing = false
......@@ -345,7 +345,12 @@ let gen_plot_file rif_file vars to_hide ttbl file tk =
(" every ::"^ !min_step^"::"^ !max_step)
in
let put_one_var (var:string) (i:int) =
let is_num = try (fst (List.assoc var ttbl)) <> "bool" with _ -> false in (* don't crash for that... *)
let is_num = try (fst (List.assoc var ttbl)) <> "bool" with _ ->
let var_tbl_str = String.concat ", " (List.map (fun (n,_) -> n) ttbl) in
output_string stderr ("Warning: cannot find "^ var ^ " in "^var_tbl_str^"\n");
flush stderr;
false
in (* don't crash for that... *)
put ("\"" ^ file ^ "\" "^step_range^" using 1:" ^ (string_of_int i) ^
(if is_num then (" title \"" ^ var ^ "\" ") else " notitle ") ^
(* (if not is_num then *)
......@@ -615,11 +620,14 @@ let plot_file = ref ""
let rec speclist =
[
"-no-display",Arg.Unit (fun _ -> (terminal := NoDisplay)),
"\t do not launch gnuplot once the gnuplot file are generated";
"-wxt",Arg.Unit (fun _ -> (terminal := Wxt)),
"\t use gnuplot with the wxt terminal (default)";
"\t launch gnuplot with the wxt terminal (default)";
"-x11",Arg.Unit (fun _ -> (terminal := X11)),
"\t use gnuplot with the X11 terminal";
"\t launch gnuplot with the X11 terminal";
"-jpg",Arg.Unit (fun _ -> (terminal := Jpg)),
"\t to output in a jpg file";
......@@ -709,7 +717,7 @@ let main () =
if debug_parsing then
(
output_string stderr "\nvar names are :\n";
List.iter (fun x -> print_string (x ^ "\n")) vars;
List.iter (fun x -> output_string stderr (x ^ "\n")) vars;
flush stderr
);
......
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