[honu] add phase{ ... }, which is like begin-for-syntax
This commit is contained in:
parent
f91d9ded25
commit
d7ebe6599c
|
@ -33,6 +33,7 @@
|
|||
[honu-new new]
|
||||
[honu-while while]
|
||||
[honu-macro macro]
|
||||
[honu-phase phase]
|
||||
[honu-primitive-macro primitive_macro]
|
||||
[honu-pattern pattern]
|
||||
[racket:read-line readLine]
|
||||
|
|
|
@ -449,3 +449,13 @@
|
|||
(make name))))
|
||||
#'rest
|
||||
#f)])))
|
||||
|
||||
;; like begin-for-syntax
|
||||
(provide honu-phase)
|
||||
(define-honu-syntax honu-phase
|
||||
(lambda (code)
|
||||
(syntax-parse code #:literal-sets (cruft)
|
||||
[(_ (#%braces body ...) . rest)
|
||||
(define out
|
||||
(phase1:racket-syntax (begin-for-syntax (parse-stuff body ...))))
|
||||
(values out #'rest #t)])))
|
||||
|
|
Loading…
Reference in New Issue
Block a user