classes.builtin classes.mixin classes.tuple classes.tuple.parser
combinators combinators.short-circuit compiler.errors
compiler.units continuations definitions destructors
-effects.parser fry generic generic.math generic.parser
+effects.parser fixups fry generic generic.math generic.parser
generic.single grouping io io.encodings io.styles kernel
kernel.private lexer libc make math math.order math.parser
math.ratios namespaces parser prettyprint sequences
error-continuation get name>> assoc-stack ;
: :res ( n -- * )
- 1 - restarts [ nth f ] change-global continue-restart ;
+ 1 - restarts [ nth f ] change-global
+ [ dup no-op-restart = [ drop f ] when ] change-obj
+ continue-restart ;
: :1 ( -- * ) 1 :res ;
: :2 ( -- * ) 2 :res ;
error>> summary ;
M: lexer-error compute-restarts
- error>> compute-restarts ;
+ [ error-continuation get swap compute-fixups ] [ error>> compute-restarts ] bi append ;
M: lexer-error error-help
error>> error-help ;
! Copyright (C) 2021 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs continuations formatting kernel
-sequences ui.tools.debugger vocabs vocabs.parser ;
+sequences vocabs vocabs.parser ;
IN: fixups
CONSTANT: vocab-renames {
] [
swap '[
first2 dupd first2 "Fixup: %s renamed to %s in Factor %s" sprintf
- swap drop no-op-action
+ swap drop no-op-restart
_ <restart>
] map
] if-empty ;
TUPLE: debugger < track error restarts restart-hook restart-list continuation ;
-! The "Abort" restart is actually an `f` object, so to show a restart
-! with information but do nothing, we define a no-op-action
-SINGLETON: no-op-action
-
<PRIVATE
SINGLETON: restart-renderer
dup restarts>> f prefix <model> restart-renderer <table>
[
[
- dup obj>> no-op-action =
+ ! The "Abort" restart is actually an `f` object, so to show a restart
+ ! with information but do nothing, we define a no-op-restart
+ dup obj>> no-op-restart =
[ drop ] [ \ continue-restart invoke-command ] if
] when*
] >>action
SYMBOL: error-thread
SYMBOL: restarts
+SINGLETON: no-op-restart
+
<PRIVATE
: (get-catchstack) ( -- catchstack )