- added action-clause without bindings for convenience

- fixed expect macro
This commit is contained in:
frese 2004-08-26 15:38:40 +00:00
parent 92f0933c7c
commit 3eaa70e248
1 changed files with 8 additions and 4 deletions

View File

@ -333,6 +333,8 @@
;; Syntax based on procedural interface
;; TODO: better error recognition/messages
(define-syntax expect-options-clauses
(syntax-rules (on-timeout timeout echo max-size monitor)
((expect-options-clauses)
@ -373,6 +375,8 @@
(lambda () exp)
(lambda (v) (proc v)))
(expect-action-clauses clause ...)))
((expect-action-clauses (pattern () body ...) clause ...)
(expect-action-clauses (pattern (ignore) body ...) clause ...))
((expect-action-clauses (pattern (match mvars ...) body ...) clause ...)
(cons (list 'match (lambda () pattern)
(lambda (m)
@ -399,10 +403,10 @@
(define-syntax expect
(syntax-rules ()
((expect (x ...) eclause ...)
(let ((r (expect-clauses (x ...) eclause ...)))
(expect* (car r) (cdr r))))
((expect name (var-inits ...) eclause ...)
(let name (var-inits ...)
(let ((r (expect-clauses eclause ...)))
(expect* (car r) (cdr r)))))
((expect (x ...) eclause ...)
(let ((r (expect-clauses (x ...) eclause ...)))
(expect* (car r) (cdr r))))))
(expect* (car r) (cdr r)))))))