diff options
author | Matus Goljer <matus.goljer@gmail.com> | 2015-10-09 18:08:16 +0200 |
---|---|---|
committer | Matus Goljer <matus.goljer@gmail.com> | 2015-10-09 18:23:29 +0200 |
commit | 2002900645cf828b4d7303bfe79113ce3d03ca58 (patch) | |
tree | a58c904792a0301a88f27039bd20a505686d1207 /lisp | |
parent | b25eb27866bfed56e252607e1a24289431f993ad (diff) | |
download | fork-ledger-2002900645cf828b4d7303bfe79113ce3d03ca58.tar.gz fork-ledger-2002900645cf828b4d7303bfe79113ce3d03ca58.tar.bz2 fork-ledger-2002900645cf828b4d7303bfe79113ce3d03ca58.zip |
Fix separator and amount regexp in context computation.
Before the fix the amount required decimal point even when the decimal
digits were optional. Now both are optional.
The separator regexp didn't have capture group so all the further fields
shifted one field back (amount went into separator, commodity into
amount etc.)
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-context.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/ledger-context.el b/lisp/ledger-context.el index 643ebdd3..629d51a5 100644 --- a/lisp/ledger-context.el +++ b/lisp/ledger-context.el @@ -34,8 +34,8 @@ (defconst ledger-indent-string "\\(^[ \t]+\\)") (defconst ledger-status-string "\\(* \\|! \\)?") (defconst ledger-account-string "[\\[(]?\\(.*?\\)[])]?") -(defconst ledger-separator-string "\\s-\\s-+") -(defconst ledger-amount-string "\\(-?[0-9]+[\\.,][0-9]*\\)") +(defconst ledger-separator-string "\\(\\s-\\s-+\\)") +(defconst ledger-amount-string "\\(-?[0-9]+\\(?:[\\.,][0-9]*\\)?\\)") (defconst ledger-comment-string "[ \t]*;[ \t]*\\(.*?\\)") (defconst ledger-nil-string "\\([ \t]\\)") (defconst ledger-commodity-string "\\(.+?\\)") |