From 909fed6f2f8d381b5ddf8789d7209e1f3e446ec9 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 7 Mar 2018 10:05:19 -0700 Subject: [PATCH] expander: reapirs for implicit-form errors Add missing source for unavailable `#%datum`, etc., and other similar adjustments. --- racket/src/expander/boot/load-handler.rkt | 2 +- racket/src/expander/expand/syntax-implicit-error.rkt | 6 ++++-- racket/src/racket/src/startup.inc | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/racket/src/expander/boot/load-handler.rkt b/racket/src/expander/boot/load-handler.rkt index 007c732e75..50aaac3ef1 100644 --- a/racket/src/expander/boot/load-handler.rkt +++ b/racket/src/expander/boot/load-handler.rkt @@ -94,7 +94,7 @@ [else (define (add-top-interaction s) (namespace-syntax-introduce - (datum->syntax s (cons '#%top-interaction s)))) + (datum->syntax #f (cons '#%top-interaction s) s))) (call-with-input-file* path (lambda (i) diff --git a/racket/src/expander/expand/syntax-implicit-error.rkt b/racket/src/expander/expand/syntax-implicit-error.rkt index 62fe7676f0..0ba08f1224 100644 --- a/racket/src/expander/expand/syntax-implicit-error.rkt +++ b/racket/src/expander/expand/syntax-implicit-error.rkt @@ -19,16 +19,18 @@ (define unbound? (and trigger-id (not (resolve trigger-id phase)))) (raise-syntax-error #f (format (if unbound? - "unbound identifier;\n also, no ~a transformer is bound~a" + "unbound identifier;\n also, no ~a syntax transformer is bound~a" (string-append what " is not allowed;\n no ~a syntax transformer is bound~a")) sym (case phase [(0) ""] [(1) " in the transformer phase"] [else (format " at phase ~a" phase)])) - (and unbound? trigger-id) (and unbound? (not (eq? (syntax-e s) (syntax-e trigger-id))) s) + (if unbound? + trigger-id + s) null (if unbound? (syntax-debug-info-string trigger-id ctx) ""))) diff --git a/racket/src/racket/src/startup.inc b/racket/src/racket/src/startup.inc index 7e73b4fb7a..54f2994d07 100644 --- a/racket/src/racket/src/startup.inc +++ b/racket/src/racket/src/startup.inc @@ -16927,7 +16927,7 @@ static const char *startup_source = " #f" "(format" "(if unbound?_0" -" \"unbound identifier;\\n also, no ~a transformer is bound~a\"" +" \"unbound identifier;\\n also, no ~a syntax transformer is bound~a\"" " (string-append what_1 \" is not allowed;\\n no ~a syntax transformer is bound~a\"))" " sym_27" "(let-values(((tmp_17) phase_44))" @@ -16936,8 +16936,8 @@ static const char *startup_source = "(if(equal? tmp_17 1)" " (let-values () \" in the transformer phase\")" " (let-values () (format \" at phase ~a\" phase_44))))))" -"(if unbound?_0 trigger-id_0 #f)" "(if unbound?_0(if(not(eq?(syntax-e$1 s_0)(syntax-e$1 trigger-id_0))) s_0 #f) #f)" +"(if unbound?_0 trigger-id_0 s_0)" " null" " (if unbound?_0 (syntax-debug-info-string trigger-id_0 ctx_8) \"\"))))))))" "(define-values(make-check-no-duplicate-table)(lambda()(begin '#hasheq())))" @@ -59402,7 +59402,7 @@ static const char *startup_source = "(begin" " 'add-top-interaction" "(1/namespace-syntax-introduce" -"(1/datum->syntax s_429(cons '#%top-interaction s_429)))))))" +"(1/datum->syntax #f(cons '#%top-interaction s_429) s_429))))))" "(let-values(((path1_0) path_12)" "((temp2_8)" "(lambda(i_84)"