diff --git a/basis/source-files/errors/debugger/debugger.factor b/basis/source-files/errors/debugger/debugger.factor new file mode 100644 index 0000000000..bf3b57f56b --- /dev/null +++ b/basis/source-files/errors/debugger/debugger.factor @@ -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+ "" + +: 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 ; + diff --git a/basis/tools/errors/errors.factor b/basis/tools/errors/errors.factor index 0bf271535a..e83f553f63 100644 --- a/basis/tools/errors/errors.factor +++ b/basis/tools/errors/errors.factor @@ -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+ "" - -: 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 ; diff --git a/core/vocabs/loader/loader.factor b/core/vocabs/loader/loader.factor index 56866fca01..6a1f781713 100644 --- a/core/vocabs/loader/loader.factor +++ b/core/vocabs/loader/loader.factor @@ -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