Skip to content

Commit 3f77208

Browse files
authored
Merge pull request #124 from hackberrydev/refactor-parsers
Refactor parsers
2 parents 9180279 + a26bd16 commit 3f77208

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/plan/parser.janet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
(constant :days) :days)
1515
,plan/build-plan)
1616
:title (* "# " :text-line "\n")
17-
:text-line (capture (some (if-not "\n" 1)))
17+
:text-line (capture (to (+ "\n" -1)))
1818
:inbox
1919
{:main (* :inbox-title (? "\n") :tasks (? "\n"))
2020
:inbox-title (* "## Inbox" (? "\n"))}
@@ -28,7 +28,7 @@
2828
{:main (group (any :event))
2929
:event
3030
{:main (replace (* :event-begin :text-line (? "\n")) ,event/build-event)
31-
:event-begin (* "- " (if-not "[" 0))}}}}
31+
:event-begin (* "- " (not "["))}}}}
3232
:tasks
3333
{:main (group (any :task))
3434
:task

src/schedule_parser.janet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
:task
1313
{:main (replace (* "- " (line) :task-title :task-schedule (? "\n"))
1414
,task/build-scheduled-task)
15-
:task-title (replace (capture (some (if-not (+ "(" "\n") 1))) ,string/trim)
15+
:task-title (replace (capture (some (to (+ "(" "\n")))) ,string/trim)
1616
:task-schedule (* "(" (replace (capture (some (+ :w+ :s+ "-"))) ,string/trim) ")")}}})
1717

1818
(defn- task-lines-count

0 commit comments

Comments
 (0)