recover: result;
authorwenzelm
Fri, 29 Dec 2000 19:44:13 +0100
changeset 10746 01e2d857fb78
parent 10745 0f3537fad0f3
child 10747 794cd4d768b5
recover: result;
src/Pure/General/scan.ML
src/Pure/General/source.ML
--- a/src/Pure/General/scan.ML	Fri Dec 29 19:43:52 2000 +0100
+++ b/src/Pure/General/scan.ML	Fri Dec 29 19:44:13 2000 +0100
@@ -55,10 +55,10 @@
   val error: ('a -> 'b) -> 'a -> 'b
   val source': string -> (string -> 'a -> 'b list * 'a) -> ('b list * 'a -> 'c) ->
     'b * ('b -> bool) -> ('d * 'b list -> 'e list * ('d * 'b list)) ->
-    ('d * 'b list -> 'f * ('d * 'b list)) option -> 'd * 'a -> 'e list * ('d * 'c)
+    ('d * 'b list -> 'e list * ('d * 'b list)) option -> 'd * 'a -> 'e list * ('d * 'c)
   val source: string -> (string -> 'a -> 'b list * 'a) -> ('b list * 'a -> 'c) ->
     'b * ('b -> bool) -> ('b list -> 'd list * 'b list) ->
-    ('b list -> 'e * 'b list) option -> 'a -> 'd list * 'c
+    ('b list -> 'd list * 'b list) option -> 'a -> 'd list * 'c
   val single: ('a -> 'b * 'a) -> 'a -> 'b list * 'a
   val bulk: ('a -> 'b * 'a) -> 'a -> 'b list * 'a
   type lexicon
@@ -207,12 +207,11 @@
 
 fun source' def_prmpt get unget stopper scanner opt_recover (state, src) =
   let
-    fun drain_with scan = drain def_prmpt get stopper scan;
+    val drain_with = drain def_prmpt get stopper;
 
     fun drain_loop recover inp =
       drain_with (catch scanner) inp handle FAIL msg =>
-        (error_msg (if_none msg "Syntax error.");
-          drain_loop recover (apfst snd (drain_with recover inp)));
+        (error_msg (if_none msg "Syntax error."); drain_with recover inp);
 
     val ((ys, (state', xs')), src') =
       (case (get def_prmpt src, opt_recover) of
--- a/src/Pure/General/source.ML	Fri Dec 29 19:43:52 2000 +0100
+++ b/src/Pure/General/source.ML	Fri Dec 29 19:44:13 2000 +0100
@@ -23,10 +23,10 @@
   val of_stream: TextIO.instream -> TextIO.outstream -> (string, unit) source
   val tty: (string, unit) source
   val source': 'a -> 'b * ('b -> bool) -> ('a * 'b list -> 'c list * ('a * 'b list)) ->
-    ('a * 'b list -> 'd * ('a * 'b list)) option ->
+    ('a * 'b list -> 'c list * ('a * 'b list)) option ->
     ('b, 'e) source -> ('c, 'a * ('b, 'e) source) source
   val source: 'a * ('a -> bool) -> ('a list -> 'b list * 'a list) ->
-    ('a list -> 'c * 'a list) option ->
+    ('a list -> 'b list * 'a list) option ->
     ('a, 'd) source -> ('b, ('a, 'd) source) source
 end;