From 4f1d4ac662d6aeb8e63ddcd4575f9ef6313a565b Mon Sep 17 00:00:00 2001 From: acondolu Date: Fri, 14 Jul 2017 20:32:20 +0200 Subject: [PATCH] Fixed problems separator in parser: now it is $ A separable problem's label may start with '!', a not separable's with '?' (cherry picked from commit 71f8eb7befd85ff4911658136597b41ed177ff8c) --- ocaml/parser.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ocaml/parser.ml b/ocaml/parser.ml index a1a9d95..15e2a6a 100644 --- a/ocaml/parser.ml +++ b/ocaml/parser.ml @@ -175,7 +175,9 @@ prerr_endline (s); if line = "" then chr, name, div, conv, ps else let rec aux' chr line = if chr = "#" - then chr, line, div, conv, ps + then chr, name, div, conv, ps + else if chr = "$" + then "#", line, div, conv, ps else if chr = "D" then chr, name, line, conv, ps else if chr = "C" @@ -235,6 +237,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 "\r?\n\r?\n\\#") txt in - List.map problem_of_string problems + let problems = Str.split (Str.regexp "\\$") txt in + List.map problem_of_string (List.tl (List.map ((^) "$") problems)) ;; -- 2.39.2