]> gitweb.factorcode.org Git - factor.git/commitdiff
listener: allow ctrl-break to interrupt user code parsing
authorAlexander Iljin <ajsoft@yandex.ru>
Mon, 30 May 2016 22:26:48 +0000 (01:26 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 1 Nov 2016 23:53:00 +0000 (16:53 -0700)
This makes it possible to trap infinite loops in the vocab loading process.

basis/listener/listener.factor

index 4c792ae67bba647cee06528e4103237de12b33d7..ba9a7546ba118e429cd76815dbe92bf573e254dd 100644 (file)
@@ -29,7 +29,8 @@ M: object prompt.
     [ disable-ctrl-break ] [ ] cleanup ; inline
 
 : parse-lines-interactive ( lines -- quot/f )
-    [ parse-lines ] with-compilation-unit ;
+    [ [ parse-lines ] with-ctrl-break
+    ] with-compilation-unit ;
 
 : read-quot-step ( lines -- quot/f )
     [ parse-lines-interactive ] [