Commit b72ae671 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-07-30 10:34:39 by cvscast] Don't report unused branches after error in toplevel

Original author: cvscast
Date: 2003-07-30 10:34:39+00:00
parent 179182a1
...@@ -206,6 +206,7 @@ let rec phrases ppf phs = match phs with ...@@ -206,6 +206,7 @@ let rec phrases ppf phs = match phs with
| [] -> () | [] -> ()
let run rule ppf ppf_err input = let run rule ppf ppf_err input =
Typer.clear_unused_branches ();
try try
let p = let p =
try rule input try rule input
......
...@@ -1112,6 +1112,9 @@ let rec unused_branches b = ...@@ -1112,6 +1112,9 @@ let rec unused_branches b =
let report_unused_branches () = let report_unused_branches () =
unused_branches !cur_branch; unused_branches !cur_branch;
cur_branch := [] cur_branch := []
let clear_unused_branches () =
cur_branch := []
(* Schema stuff from now on ... *) (* Schema stuff from now on ... *)
......
...@@ -40,6 +40,7 @@ val type_rec_funs: env -> Typed.texpr list -> (id * Types.descr) list ...@@ -40,6 +40,7 @@ val type_rec_funs: env -> Typed.texpr list -> (id * Types.descr) list
val report_unused_branches : unit -> unit val report_unused_branches : unit -> unit
(* Issue warnings for unused branches *) (* Issue warnings for unused branches *)
val clear_unused_branches : unit -> unit
val flatten: Location.loc -> val flatten: Location.loc ->
(Types.descr -> bool -> Types.descr) -> (Types.descr -> bool -> Types.descr) (Types.descr -> bool -> Types.descr) -> (Types.descr -> bool -> Types.descr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment