improvements

dev-validator
Matthew Butterick 11 years ago
parent bfbad62fef
commit 2f4bbcd48f

@ -77,11 +77,11 @@
(define (validate-txexpr-attrs-with-context? e) (validate-txexpr-attrs? e #:context x)) (define (validate-txexpr-attrs-with-context? e) (validate-txexpr-attrs? e #:context x))
(when (match x (when (match x
[(list (? symbol? name) rest ...) ;; is a list starting with a symbol [(list (? symbol?)) #t]
(or (null? rest) [(list (? symbol? name) (and attr-list (list (list k v ...) ...)) rest ...)
(andmap txexpr-element? rest) ;; the rest is content or ... (and (validate-txexpr-attrs-with-context? attr-list)
(and (validate-txexpr-attrs-with-context? (car rest)) (andmap validate-txexpr-element-with-context? rest))]
(andmap validate-txexpr-element-with-context? (cdr rest))))] ;; attr + content [(list (? symbol? name) rest ...)(andmap validate-txexpr-element-with-context? rest)]
[else (error (format "validate-txexpr: first element is not a symbol in ~v" x))]) [else (error (format "validate-txexpr: first element is not a symbol in ~v" x))])
x)) x))

Loading…
Cancel
Save