]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/listener/listener.factor
basis,extra: refactorings to use the ignore-error and ignore-error/f words
[factor.git] / basis / listener / listener.factor
index d1cea41e28212c95b1b4b4b2a974da8731a9b7cf..12e8b1ebf57ede2495c045ac33f6f0d6d35216cd 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2003, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors colors colors.constants
-combinators.short-circuit compiler.units continuations debugger
-fry io io.styles kernel lexer literals locals math math.parser
-namespaces parser parser.notes prettyprint sequences sets
-source-files.errors system vocabs vocabs.loader
+USING: accessors colors colors.constants combinators.short-circuit
+compiler.units continuations debugger fry io io.styles kernel lexer
+locals math math.parser namespaces parser parser.notes prettyprint
+sequences sets source-files.errors system vocabs vocabs.loader
 vocabs.parser ;
 IN: listener
 
@@ -40,10 +39,8 @@ SYMBOL: handle-ctrl-break
     [ [ parse-lines ] with-ctrl-break ] with-compilation-unit ;
 
 : read-quot-step ( lines -- quot/f )
-    [ parse-lines-interactive ] [
-        dup error>> unexpected-eof?
-        [ 2drop f ] [ rethrow ] if
-    ] recover ;
+    '[ _ parse-lines-interactive ]
+    [ error>> unexpected-eof? ] ignore-error/f ;
 
 : read-quot-loop ( stream accum -- quot/f )
     over stream-readln dup [