From c5e30d8af545c0f64a6a1416b21f98289f8f8362 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Thu, 1 Mar 2012 17:35:46 -0500 Subject: [PATCH] Use the correct #%app for applications of `local' bound identifiers in the student languages. --- collects/lang/private/teachhelp.rkt | 21 +++++++-------------- collects/tests/htdp-lang/intm-intml.rktl | 9 +++++++++ collects/tests/htdp-lang/syntax.rkt | 5 +++++ 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 collects/tests/htdp-lang/syntax.rkt diff --git a/collects/lang/private/teachhelp.rkt b/collects/lang/private/teachhelp.rkt index 01d4c22be3..bf5b7696c4 100644 --- a/collects/lang/private/teachhelp.rkt +++ b/collects/lang/private/teachhelp.rkt @@ -1,7 +1,8 @@ (module teachhelp mzscheme (require "firstorder.rkt" "rewrite-error-message.rkt" - stepper/private/shared) + stepper/private/shared + (for-template (prefix r: racket/base))) (require-for-syntax stepper/private/shared) @@ -18,19 +19,11 @@ (with-syntax ([tmp-id tmp-id]) (syntax/loc stx (set! tmp-id expr)))] [(id . args) - (datum->syntax-object - check-proc - (cons (stepper-syntax-property - (datum->syntax-object - check-proc - (list check-proc - (list 'quote (syntax id)) - tmp-id)) - 'stepper-skipto - (append skipto/cdr - skipto/third)) - (syntax args)) - stx)] + (datum->syntax-object + stx + (cons '#%app stx) + stx + stx)] [id (stepper-syntax-property (datum->syntax-object diff --git a/collects/tests/htdp-lang/intm-intml.rktl b/collects/tests/htdp-lang/intm-intml.rktl index 947ff2d6a4..6995d3a9d9 100644 --- a/collects/tests/htdp-lang/intm-intml.rktl +++ b/collects/tests/htdp-lang/intm-intml.rktl @@ -1,3 +1,12 @@ (htdp-syntax-test #'(let name ([x 12]) 10) "let: expected at least one binding (in parentheses) after let, but found something else") +(htdp-top (require "syntax.rkt")) + +(htdp-syntax-test #'(let-syntax ([#%app (lambda (stx) (raise-syntax-error #f "app fail" stx))]) + (local [(define (x a b) 1)] + (x 1 2))) + "app fail") + +(htdp-top-pop 1) + diff --git a/collects/tests/htdp-lang/syntax.rkt b/collects/tests/htdp-lang/syntax.rkt new file mode 100644 index 0000000000..896ecf244c --- /dev/null +++ b/collects/tests/htdp-lang/syntax.rkt @@ -0,0 +1,5 @@ +#lang racket + +(require (for-syntax racket/base)) +(provide (for-syntax (all-from-out racket/base))) +(provide let-syntax) \ No newline at end of file