diff --git a/main.rkt b/main.rkt index c17a400..51d1928 100644 --- a/main.rkt +++ b/main.rkt @@ -260,7 +260,7 @@ racket main.rkt -e \"/home/bost/der/search-notes/main.rkt /home/bost/der/search- (lambda (input-file) ;; (printf "1. input-file:\n~a\n" input-file) (define expression - `(notes + `(notes-syntax-parser ,@((compose ;; (lambda (p) (printf "13. ~a\n" p) p) (curry cons pattern-with-diacritics) diff --git a/notes-reader.rkt b/notes-reader.rkt index 70b7231..a44867d 100644 --- a/notes-reader.rkt +++ b/notes-reader.rkt @@ -1,14 +1,18 @@ #lang racket -(provide (rename-out (notes-read-syntax read-syntax)) +(provide (rename-out + ;; Every reader must export a read-syntax function. + (notes-read-syntax read-syntax)) parse-notes) (require syntax/readerr) +;; A read-syntax must return code describing a module, packaged as a syntax +;; object. (define (notes-read-syntax src in) (datum->syntax #f `(module notes racket (require "notes.rkt") - (notes + (notes-syntax-parser ,@(parse-notes src in))))) ;; `src` - context information about what file this code resides in. The value diff --git a/notes.rkt b/notes.rkt index f1b88f6..24e477a 100644 --- a/notes.rkt +++ b/notes.rkt @@ -1,5 +1,5 @@ #lang racket -(provide notes) +(provide notes-syntax-parser) (require (for-syntax syntax/parse racket/function ;; curry @@ -9,9 +9,9 @@ #;(require (rename-in racket/function (curry partial))) -(define-syntax (notes form) +(define-syntax (notes-syntax-parser form) (syntax-parse form - ((notes + ((notes-syntax-parser text:string case-sensitivity:string colorize-matches:boolean