pull/9/head
Matthew Butterick 11 years ago
parent 1be42e1bde
commit 9be9cf01fe

@ -30,13 +30,13 @@
(define+provide (validate-pagetree x)
(let ([pagenodes (pagetree->list x)])
(and
(txexpr? x)
(andmap (λ(p) (or (pagenode? p) (error (format "validate-pagetree: \"~a\" is not a valid pagenode" p)))) pagenodes)
(try (members-unique?/error pagenodes)
(except [exn:fail? (λ(e) (error (format "validate-pagetree: ~a" (exn-message e))))]))
x)))
(and (txexpr? x)
(let ([pagenodes (pagetree->list x)])
(and
(andmap (λ(p) (or (pagenode? p) (error (format "validate-pagetree: \"~a\" is not a valid pagenode" p)))) pagenodes)
(try (members-unique?/error pagenodes)
(except [exn:fail? (λ(e) (error (format "validate-pagetree: ~a" (exn-message e))))]))
x))))
(define+provide (pagetree? x)

@ -22,7 +22,10 @@
(datum->syntax file-contents
`(module pollen-lang-module pollen
(define reader-mode ',reader-mode)
(define reader-here-path ,(if (symbol? path-string) (symbol->string path-string) (path->string path-string)))
(define reader-here-path ,(cond
[(symbol? path-string) (symbol->string path-string)]
[(equal? path-string "unsaved editor") path-string]
[else (path->string path-string)]))
,(require+provide-project-require-files path-string)
,@file-contents)
file-contents)))

Loading…
Cancel
Save