Skip to content

Commit

Permalink
clean up grammar files so they compile without error
Browse files Browse the repository at this point in the history
also fix a bug in the tokenizer for PRIORITY which was missing an :or

this should close github issue #2
  • Loading branch information
tgbugs committed Feb 5, 2022
1 parent 3739c90 commit fa9e70a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions laundry/grammar/planning.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ plan-open : CHARS-OPENED ; XXX suggested improvement
plan-close : CHARS-CLOSED

timestamp : TIMESTAMP

wsnn : WSNN
5 changes: 5 additions & 0 deletions laundry/grammar/timestamp.rkt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#lang brag
;;; timestamps

; the org spec is currently silent on how org will handle dates beyond
Expand Down Expand Up @@ -85,3 +86,7 @@ ts-rod-entry : ts-rod-mark ts-rod-value ts-rod-unit
ts-rod-mark : "+" | "++" | ".+" | "-" | "--"
ts-rod-value : digits
ts-rod-unit : "h" | "d" | "w" | "m" | "y"

space : SPACE
digits : DIGITS
not-lsb-hy-plus-digit-whitespace : WAT
2 changes: 1 addition & 1 deletion laundry/tokenizer.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ using from/stop-before where the stop-before pattern contains multiple charachte
(token 'TAGS lexeme)]
["COMMENT" (token 'CHARS-COMMENT lexeme)] ; this must come befor RTK
[(:or #,@keywords) (token 'RUNTIME-TODO-KEYWORD lexeme)]
[(:seq "[#" (0-9 alpha) "]") (token 'PRIORITY lexeme)] ; lower case allowed but it is upcased internally (base36)
[(:seq "[#" (:or 0-9 alpha) "]") (token 'PRIORITY lexeme)] ; lower case allowed but it is upcased internally (base36)
[(:or " " "\t") (token 'BLANK lexeme)] ; unfortunately we still have to split on space
[(:seq (:+ (:~ #;"*" "[" "]" ":" "\n" " " "\t")))
(token 'OTHER lexeme)]
Expand Down

0 comments on commit fa9e70a

Please sign in to comment.