From 459a59a954fbad87b6a0d24c025338a0b0502d5b Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 30 Sep 2013 15:41:18 -0500 Subject: [PATCH] adjust check syntax so it can show info before expansion completes and sometimes when there are syntax errors raised In more detail, rearrange online check syntax's internal plumbing so that syntax objects can be handed to check syntax at any point (via a special log message, see the changes to the docs) not just when expansion is finished Use this in TR to get check syntax information even when there is a type error (and also get the check syntax information processing started before type checking starts (altho this isn't running in a separate place, so there is no new parallelism here)) original commit: 09920bd8ce46f15d9cf4a5066ab2cfb84bbdd417 --- .../typed-racket-lib/typed-racket/tc-setup.rkt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/tc-setup.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/tc-setup.rkt index f7a95a4c..3cda760f 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/tc-setup.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/tc-setup.rkt @@ -42,6 +42,8 @@ . body))) +(define-logger online-check-syntax) + (define (tc-setup/proc orig-stx stx expand-ctxt init checker f) (set-box! typed-context? #t) ;(start-timing (syntax-property stx 'enclosing-module-name)) @@ -62,6 +64,12 @@ (when (show-input?) (pretty-print (syntax->datum fully-expanded-stx))) (do-time "Local Expand Done") + (let ([exprs (syntax->list (syntax-local-introduce fully-expanded-stx))]) + (when (pair? exprs) + (log-message online-check-syntax-logger + 'info + "TR's expanded syntax objects; this message is ignored" + (cdr exprs)))) (init) (do-time "Initialized Envs") (find-mutated-vars fully-expanded-stx mvar-env)