better syntax checking for scribble defform #:literals
svn: r12647 original commit: 88b0e558c3d0fc72cc7962ad29cc2142ceb81637
This commit is contained in:
parent
10af6b4da4
commit
58f9cd85ed
|
@ -45,6 +45,13 @@
|
||||||
spec
|
spec
|
||||||
spec)]
|
spec)]
|
||||||
[_ spec])))])
|
[_ spec])))])
|
||||||
|
(for-each (lambda (id)
|
||||||
|
(unless (identifier? id)
|
||||||
|
(raise-syntax-error #f
|
||||||
|
"expected an identifier for a literal"
|
||||||
|
stx
|
||||||
|
id)))
|
||||||
|
(syntax->list #'(lit ...)))
|
||||||
#'(with-togetherable-scheme-variables
|
#'(with-togetherable-scheme-variables
|
||||||
(lit ...)
|
(lit ...)
|
||||||
([form spec] [form spec1] ...
|
([form spec] [form spec1] ...
|
||||||
|
@ -109,13 +116,21 @@
|
||||||
(define-syntax (defform/none stx)
|
(define-syntax (defform/none stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ #:literals (lit ...) spec desc ...)
|
[(_ #:literals (lit ...) spec desc ...)
|
||||||
#'(with-togetherable-scheme-variables
|
(begin
|
||||||
(lit ...)
|
(for-each (lambda (id)
|
||||||
([form spec])
|
(unless (identifier? id)
|
||||||
(*defforms #f
|
(raise-syntax-error #f
|
||||||
'(spec) (list (lambda (ignored) (schemeblock0/form spec)))
|
"expected an identifier for a literal"
|
||||||
null null
|
stx
|
||||||
(lambda () (list desc ...))))]
|
id)))
|
||||||
|
(syntax->list #'(lit ...)))
|
||||||
|
#'(with-togetherable-scheme-variables
|
||||||
|
(lit ...)
|
||||||
|
([form spec])
|
||||||
|
(*defforms #f
|
||||||
|
'(spec) (list (lambda (ignored) (schemeblock0/form spec)))
|
||||||
|
null null
|
||||||
|
(lambda () (list desc ...)))))]
|
||||||
[(_ spec desc ...)
|
[(_ spec desc ...)
|
||||||
#'(defform/none #:literals () spec desc ...)]))
|
#'(defform/none #:literals () spec desc ...)]))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user