add txexpr validation to pollen/markup compile in DrRacket

pull/27/head
Matthew Butterick 10 years ago
parent d780cc968f
commit df9036e369

@ -45,14 +45,16 @@
(prefix-out inner: reader-mode) (prefix-out inner: reader-mode)
(prefix-out inner: parser-mode)) (prefix-out inner: parser-mode))
,(require+provide-project-require-files path-string) ,(require+provide-directory-require-files path-string)
,@file-contents) ,@file-contents)
(require 'pollen-lang-module) (require 'pollen-lang-module)
(provide (all-from-out 'pollen-lang-module)) (provide (all-from-out 'pollen-lang-module))
(module+ main (module+ main
(require txexpr racket/string)
(if (or (equal? inner:parser-mode world:mode-preproc) (equal? inner:parser-mode world:mode-template)) (if (or (equal? inner:parser-mode world:mode-preproc) (equal? inner:parser-mode world:mode-template))
(display doc) (display doc)
(print doc)))) (print (with-handlers ([exn:fail? (λ(exn) ((error '|pollen markup error| (string-join (cdr (string-split (exn-message exn) ": ")) ": "))))])
(validate-txexpr doc))))))
file-contents))) file-contents)))

Loading…
Cancel
Save