From df9036e369467c5a6441ba630c08e07c0711d719 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 6 Sep 2014 07:43:00 -0700 Subject: [PATCH] add txexpr validation to pollen/markup compile in DrRacket --- reader-base.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reader-base.rkt b/reader-base.rkt index 02a169d..666d619 100644 --- a/reader-base.rkt +++ b/reader-base.rkt @@ -45,14 +45,16 @@ (prefix-out inner: reader-mode) (prefix-out inner: parser-mode)) - ,(require+provide-project-require-files path-string) + ,(require+provide-directory-require-files path-string) ,@file-contents) (require 'pollen-lang-module) (provide (all-from-out 'pollen-lang-module)) (module+ main + (require txexpr racket/string) (if (or (equal? inner:parser-mode world:mode-preproc) (equal? inner:parser-mode world:mode-template)) (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)))