Use the correct #%app for applications of `local' bound identifiers in the student languages.
This commit is contained in:
parent
a39001911c
commit
c5e30d8af5
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
5
collects/tests/htdp-lang/syntax.rkt
Normal file
5
collects/tests/htdp-lang/syntax.rkt
Normal file
|
@ -0,0 +1,5 @@
|
|||
#lang racket
|
||||
|
||||
(require (for-syntax racket/base))
|
||||
(provide (for-syntax (all-from-out racket/base)))
|
||||
(provide let-syntax)
|
Loading…
Reference in New Issue
Block a user