Skip to content

Commit

Permalink
fix parser bug where by goals couldn't repeat on months/years >9 (act…
Browse files Browse the repository at this point in the history
  • Loading branch information
youngcw authored Jun 1, 2023
1 parent 66bfef2 commit 8875f6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/loot-core/src/server/budget/goal-template.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ expr

repeat 'repeat interval'
= 'month'i { return { annual: false } }
/ months: d _ 'months'i { return { annual: false, repeat: +months } }
/ months: positive _ 'months'i { return { annual: false, repeat: +months } }
/ 'year'i { return { annual: true } }
/ years: d _ 'years'i { return { annual: true, repeat: +years } }
/ years: positive _ 'years'i { return { annual: true, repeat: +years } }

limit = _? upTo _ amount: amount _ 'hold'i { return {amount: amount, hold: true } }
/ _? upTo _ amount: amount { return {amount: amount, hold: false } }
Expand All @@ -52,6 +52,7 @@ priority = '-'i number: number _ {return number}
_ 'space' = ' '+
d 'digit' = [0-9]
number 'number' = $(d+)
positive = $([1-9][0-9]*)
amount 'amount' = currencySymbol? _? amount: $(d+ ('.' (d d?)?)?) { return +amount }
percent 'percentage' = percent: $(d+) _? '%' { return +percent }
year 'year' = $(d d d d)
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/1083.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [youngcw]
---

Goals: Fix bug that made repeat values >9 fail parsing.

0 comments on commit 8875f6d

Please sign in to comment.