resume in hdl-tst
parent
f02e605a9c
commit
c0a3020947
@ -1,27 +1,26 @@
|
|||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require (for-syntax racket/base racket/syntax))
|
(require (for-syntax racket/base br/syntax)
|
||||||
|
br/define)
|
||||||
(provide (all-defined-out))
|
(provide (all-defined-out))
|
||||||
|
|
||||||
(define-syntax (report stx)
|
(define-macro-cases report
|
||||||
(syntax-case stx ()
|
|
||||||
[(_ EXPR) #'(report EXPR EXPR)]
|
[(_ EXPR) #'(report EXPR EXPR)]
|
||||||
[(_ EXPR NAME)
|
[(_ EXPR NAME)
|
||||||
#'(let ([expr-result EXPR])
|
#'(let ([expr-result EXPR])
|
||||||
(eprintf "~a = ~v\n" 'NAME expr-result)
|
(eprintf "~a = ~v\n" 'NAME expr-result)
|
||||||
expr-result)]))
|
expr-result)])
|
||||||
|
|
||||||
(define-syntax (report-datum stx)
|
(define-macro-cases report-datum
|
||||||
(syntax-case stx ()
|
|
||||||
[(_ STX-EXPR)
|
[(_ STX-EXPR)
|
||||||
(with-syntax ([datum (syntax->datum #'STX-EXPR)])
|
(with-pattern ([datum (syntax->datum #'STX-EXPR)])
|
||||||
#'(report-datum STX-EXPR datum))]
|
#'(report-datum STX-EXPR datum))]
|
||||||
[(_ STX-EXPR NAME)
|
[(_ STX-EXPR NAME)
|
||||||
#'(let ()
|
#'(let ()
|
||||||
(eprintf "~a = ~v\n" 'NAME (syntax->datum STX-EXPR))
|
(eprintf "~a = ~v\n" 'NAME (syntax->datum STX-EXPR))
|
||||||
STX-EXPR)]))
|
STX-EXPR)])
|
||||||
|
|
||||||
(define-syntax-rule (define-multi-version MULTI-NAME NAME)
|
(define-macro (define-multi-version MULTI-NAME NAME)
|
||||||
(define-syntax-rule (MULTI-NAME x (... ...))
|
#'(define-macro (MULTI-NAME X (... ...))
|
||||||
(begin (NAME x) (... ...))))
|
#'(begin (NAME X) (... ...))))
|
||||||
|
|
||||||
(define-multi-version report* report)
|
(define-multi-version report* report)
|
Loading…
Reference in New Issue