diff --git a/lang/reader-base.rkt b/lang/reader-base.rkt index 001bb3c..32a0276 100644 --- a/lang/reader-base.rkt +++ b/lang/reader-base.rkt @@ -22,7 +22,7 @@ (datum->syntax file-contents `(module pollen-lang-module pollen (define reader-mode ',reader-mode) - (define here-path ,(if (symbol? path-string) (symbol->string path-string) (path->string path-string))) + (define reader-here-path ,(if (symbol? path-string) (symbol->string path-string) (path->string path-string))) ,(require+provide-project-require-files path-string) ,@file-contents) file-contents))) diff --git a/main.rkt b/main.rkt index 8e439a3..c468b72 100644 --- a/main.rkt +++ b/main.rkt @@ -49,10 +49,12 @@ (define metas (make-hash (map meta-element->assoc meta-elements))) (values doc-without-metas metas)) + ;; if reader-here-path is undefined, it will become a proc courtesy of #%top ;; therefore that's how we can detect if it's undefined (define here-path (if (procedure? reader-here-path) "anonymous-module" reader-here-path)) + (define doc-txexpr (let ([doc-raw (if (equal? parser-mode world:reader-mode-markdown) (apply (compose1 (dynamic-require 'markdown 'parse-markdown) string-append) doc-raw)