]> matita.cs.unibo.it Git - fireball-separation.git/blobdiff - ocaml/parser.ml
Fixed "$" in parser
[fireball-separation.git] / ocaml / parser.ml
index 379fb2edff3697e3e8c9740909223b1d705f61b6..f5b7d7d1173097feffd36cf74bb14dbb921cff08 100644 (file)
@@ -182,7 +182,9 @@ prerr_endline (s);
   if line = "" then chr, name, div, conv, ps else\r
   let rec aux' chr line =\r
    if chr = "#"\r
-    then chr, line, div, conv, ps\r
+    then chr, name, div, conv, ps\r
+   else if chr = "$"\r
+    then "#", line, div, conv, ps\r
    else if chr = "D"\r
     then chr, name, line, conv, ps\r
    else if chr = "C"\r
@@ -258,6 +260,6 @@ let from_file path =
  with End_of_file ->\r
   close_in chan in\r
  let txt = String.concat "\n" (List.rev !lines) in\r
- let problems = Str.split (Str.regexp "\r?\n\r?\n\\#") txt in\r
- List.map problem_of_string problems\r
+ let problems = Str.split (Str.regexp "\n\\$") txt in\r
+ List.map problem_of_string (List.tl (List.map ((^) "$") problems))\r
 ;;\r