From db562ac015ffc6c1a08c226b4eef7790b21661cd Mon Sep 17 00:00:00 2001 From: acondolu Date: Sat, 15 Jul 2017 15:05:34 +0200 Subject: [PATCH] Fixed "$" in parser --- ocaml/parser.ml | 2 +- ocaml/problems.ml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ocaml/parser.ml b/ocaml/parser.ml index 726d076..f5b7d7d 100644 --- a/ocaml/parser.ml +++ b/ocaml/parser.ml @@ -260,6 +260,6 @@ let from_file path = with End_of_file -> close_in chan in let txt = String.concat "\n" (List.rev !lines) in - let problems = Str.split (Str.regexp "\\$") txt in + let problems = Str.split (Str.regexp "\n\\$") txt in List.map problem_of_string (List.tl (List.map ((^) "$") problems)) ;; diff --git a/ocaml/problems.ml b/ocaml/problems.ml index 0374b47..bd3e880 100644 --- a/ocaml/problems.ml +++ b/ocaml/problems.ml @@ -17,9 +17,9 @@ let assert_unseparable x = let assert_depends x = let c = String.sub (Lambda4.label_of_problem (fst x)) 0 1 in - prerr_endline(Lambda4.label_of_problem (fst x)); assert (c = "!" || c="?"); - let q = c = "!" in - (if q then assert_separable else assert_unseparable) x + if c = "!" then assert_separable x + else if c = "?" then assert_unseparable x + else (solve x; ()) ;; let main () = -- 2.39.2