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
|
(module teachhelp mzscheme
|
||||||
(require "firstorder.rkt"
|
(require "firstorder.rkt"
|
||||||
"rewrite-error-message.rkt"
|
"rewrite-error-message.rkt"
|
||||||
stepper/private/shared)
|
stepper/private/shared
|
||||||
|
(for-template (prefix r: racket/base)))
|
||||||
|
|
||||||
(require-for-syntax stepper/private/shared)
|
(require-for-syntax stepper/private/shared)
|
||||||
|
|
||||||
|
@ -19,17 +20,9 @@
|
||||||
(syntax/loc stx (set! tmp-id expr)))]
|
(syntax/loc stx (set! tmp-id expr)))]
|
||||||
[(id . args)
|
[(id . args)
|
||||||
(datum->syntax-object
|
(datum->syntax-object
|
||||||
check-proc
|
stx
|
||||||
(cons (stepper-syntax-property
|
(cons '#%app stx)
|
||||||
(datum->syntax-object
|
stx
|
||||||
check-proc
|
|
||||||
(list check-proc
|
|
||||||
(list 'quote (syntax id))
|
|
||||||
tmp-id))
|
|
||||||
'stepper-skipto
|
|
||||||
(append skipto/cdr
|
|
||||||
skipto/third))
|
|
||||||
(syntax args))
|
|
||||||
stx)]
|
stx)]
|
||||||
[id
|
[id
|
||||||
(stepper-syntax-property
|
(stepper-syntax-property
|
||||||
|
|
|
@ -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-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