Change the drracket repl so that it doesn't show the stacktrace button
for syntax errors (i.e., exn:fail:syntax? exceptions) Overall, it seems important to (in most cases) not show the stack that leads to the point where raise-syntax-error is called, so as not to confuse users who might think that that stack is useful information in understanding how to fix the syntax error. I've resisted this technique for avoiding those stacks for a long time, mostly because common syntax errors in the standard settings don't usually get the stacktrace button because they usually have empty stacks (partly thanks to the with-stack-checkpoint dance). But now that the underlying racket-generated stack is shown too, and not just the errortrace-generated stack, it is harder to make those go away. More precisely, DrRacket used to be able to rely on the fact that files that were compiled to .zo files would not have the instrumentation in them and thus stackframes from that code would not show up in the stacktrace. No longer. So, it seems time to try this alternative.
This commit is contained in:
parent
cac37b0b6a
commit
e1ce0a0d1e
|
@ -30,6 +30,9 @@ profile todo:
|
|||
(define orig (current-output-port))
|
||||
(define (oprintf . args) (apply fprintf orig args))
|
||||
|
||||
(define base-phase
|
||||
(variable-reference->module-base-phase (#%variable-reference)))
|
||||
|
||||
(provide debug@)
|
||||
(define-unit debug@
|
||||
(import [prefix drracket:rep: drracket:rep^]
|
||||
|
@ -297,9 +300,9 @@ profile todo:
|
|||
|
||||
(print-planet-icon-to-stderr exn)
|
||||
(unless (exn:fail:user? exn)
|
||||
(unless (and (null? stack1)
|
||||
(null? stack2))
|
||||
(print-bug-to-stderr msg stack1 stack1-editions stack2 stack2-editions defs ints))
|
||||
(unless (exn:fail:syntax? exn)
|
||||
(unless (and (null? stack1) (null? stack2))
|
||||
(print-bug-to-stderr msg stack1 stack1-editions stack2 stack2-editions defs ints)))
|
||||
(display-srclocs-in-error src-locs src-locs-edition))
|
||||
(display msg (current-error-port))
|
||||
(when (exn:fail:syntax? exn)
|
||||
|
|
Loading…
Reference in New Issue
Block a user