Fix warnings: 4, 6, 29
[tiger.ml.git] / tiger / src / exe / tigerc.ml
index 77eafb4..9c901a7 100644 (file)
@@ -5,11 +5,12 @@ let () =
   let ic = open_in path_to_program_file in
   let lexbuf = Lexing.from_channel ic in
   let rec parse_and_print () =
-    let token = Tiger.Lexer.token lexbuf in
-    printf "%s\n" (Tiger.Parser.Token.to_string token);
-    match token with
-    | Tiger.Parser.Token.EOF -> ()
-    | _ -> parse_and_print ()
+    match Tiger.Lexer.token lexbuf with
+    | None ->
+        ()
+    | Some token ->
+        printf "%s\n" (Tiger.Parser.Token.to_string token);
+        parse_and_print ()
   in
   parse_and_print ();
   close_in ic;
This page took 0.029975 seconds and 4 git commands to generate.