From 59b73436111ddaf064814cae1569a2c5e1e4f00f Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 17 Mar 2014 08:35:04 -0700 Subject: [PATCH] update --- lang/reader-base.rkt | 2 +- main.rkt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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)