]> gitweb.factorcode.org Git - factor.git/commitdiff
rearrange source-file-error error. to load earlier
authorJoe Groff <arcata@gmail.com>
Wed, 16 Nov 2011 02:26:17 +0000 (18:26 -0800)
committerJoe Groff <arcata@gmail.com>
Wed, 16 Nov 2011 02:26:35 +0000 (18:26 -0800)
Fixes #359

basis/source-files/errors/debugger/debugger.factor [new file with mode: 0644]
basis/tools/errors/errors.factor
core/vocabs/loader/loader.factor

diff --git a/basis/source-files/errors/debugger/debugger.factor b/basis/source-files/errors/debugger/debugger.factor
new file mode 100644 (file)
index 0000000..bf3b57f
--- /dev/null
@@ -0,0 +1,20 @@
+USING: accessors debugger io kernel make math.parser
+prettyprint source-files.errors summary ;
+IN: source-files.errors.debugger
+
+CONSTANT: +listener-input+ "<Listener input>"
+
+: error-location ( error -- string )
+    [
+        [ file>> [ % ] [ +listener-input+ % ] if* ]
+        [ line#>> [ ": " % # ] when* ] bi
+    ] "" make ;
+
+M: source-file-error summary error>> summary ;
+
+M: source-file-error error.
+    [ error-location print nl ]
+    [ asset>> [ "Asset: " write short. nl ] when* ]
+    [ error>> error. ]
+    tri ;
+
index 0bf271535a31b0d80ffc1b4d0541ff0f28bebbac..e83f553f63a3afb438f7fb950a7c4bdb6b69ba88 100644 (file)
@@ -2,28 +2,12 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs debugger io kernel sequences source-files.errors
 summary accessors continuations make math.parser io.styles namespaces
-compiler.errors prettyprint ;
+compiler.errors prettyprint source-files.errors.debugger ;
 IN: tools.errors
 
 #! Tools for source-files.errors. Used by tools.tests and others
 #! for error reporting
 
-CONSTANT: +listener-input+ "<Listener input>"
-
-: error-location ( error -- string )
-    [
-        [ file>> [ % ] [ +listener-input+ % ] if* ]
-        [ line#>> [ ": " % # ] when* ] bi
-    ] "" make ;
-
-M: source-file-error summary error>> summary ;
-
-M: source-file-error error.
-    [ error-location print nl ]
-    [ asset>> [ "Asset: " write short. nl ] when* ]
-    [ error>> error. ]
-    tri ;
-
 : errors. ( errors -- )
     group-by-source-file sort-errors
     [
@@ -40,4 +24,4 @@ M: not-compiled summary
     word>> name>> "The word " " cannot be executed because it failed to compile" surround ;
 
 M: not-compiled error.
-    [ summary print nl ] [ error>> error. ] bi ;
\ No newline at end of file
+    [ summary print nl ] [ error>> error. ] bi ;
index 56866fca01cc598018884f2dbf9f04578e91c072..6a1f781713afcda6891543495a6d56e4a365eb38 100644 (file)
@@ -168,3 +168,6 @@ PRIVATE>
 ] require-hook set-global
 
 M: vocab-spec where vocab-source-path dup [ 1 2array ] when ;
+
+! put here to avoid circularity between vocabs.loader and source-files.errors
+{ "source-files.errors" "debugger" } "source-files.errors.debugger" require-when