Skip to content

Commit

Permalink
Better names and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Feb 8, 2024
1 parent 5b18791 commit 26b0c24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions notes-reader.rkt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions notes.rkt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#lang racket
(provide notes)
(provide notes-syntax-parser)
(require
(for-syntax syntax/parse
racket/function ;; curry
Expand All @@ -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
Expand Down

0 comments on commit 26b0c24

Please sign in to comment.