diff --git a/lang/inner-lang-helper.rkt b/lang/inner-lang-helper.rkt index 78c78c9..725816f 100644 --- a/lang/inner-lang-helper.rkt +++ b/lang/inner-lang-helper.rkt @@ -1,26 +1,10 @@ #lang racket/base -(require (for-syntax racket/base)) +(require (for-syntax racket/base "../project-requires.rkt")) (provide (all-defined-out)) ;; A place to stash functions that don't change between compiles of Pollen files. -;; duplicate of contents of project-require.rkt. -;; Goes faster if it's not in a separate module. -;; todo: use include? But this one has to be available as syntax -;; todo: get rid of magic value -(define-for-syntax (project-require-file? path) - (define path-string (path->string path)) - (equal? (substring path-string (- (string-length path-string) 3) (string-length path-string)) "rkt")) - -;; list of all eligible requires in project require directory -(define-for-syntax (get-project-require-files) - (define extras-directory (build-path (current-directory) "pollen-require")) - (and (directory-exists? extras-directory) - ;; #:build? option returns complete paths (instead of just file names) - (let ([files (filter project-require-file? (directory-list extras-directory #:build? #t))]) - (and (not (equal? '() files)) files)))) - (define-for-syntax (put-file-in-require-form file) `(file ,(path->string file))) diff --git a/project-requires.rkt b/project-requires.rkt index ab68113..c416417 100644 --- a/project-requires.rkt +++ b/project-requires.rkt @@ -13,8 +13,4 @@ (and (directory-exists? extras-directory) ;; #:build? option returns complete paths (instead of just file names) (let ([files (filter project-require-file? (directory-list extras-directory #:build? #t))]) - (and (not (equal? null files)) files)))) - -(module+ main -(parameterize ([world:current-project-root (string->path "/Users/mb/git/bpt/")]) - (get-project-require-files))) \ No newline at end of file + (and (not (equal? null files)) files)))) \ No newline at end of file