caml-urm

A OCaml module for manipulating unlimited register machines

Commit
accf21fd370d049d1bb9df8ffde82d74c64aed18
Parent
f79f045ac15a7e507bf77c2d68a8ecefdbf815fc
Author
Pablo <pablo-escobar@riseup.net>
Date

Fixed minor typos in the parsing function

Diffstat

1 file changed, 3 insertions, 5 deletions

Status File Name N° Changes Insertions Deletions
Modified urm.ml 8 3 5
diff --git a/urm.ml b/urm.ml
@@ -99,9 +99,7 @@ module Parse = struct
       if String.trim s <> "" then None
       else
         match Stream.npeek 8 (lex (Stream.of_string s)) with
-        | Some l -> 
-            Some (parse_instruction l)
-        | None -> 
-            raise (Syntax_error Prinf.sprintf "invalid syntax: %s" s)
-    in Array.of_list (filter_map (String.split_on_char '\n' s))
+        | Some l -> Some (parse_instruction l)
+        | None -> raise (Syntax_error (Prinf.sprintf "invalid syntax: %s" s))
+    in Array.of_list (List.filter_map f (String.split_on_char '\n' s))
 end