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.)
This commit is contained in:
Matus Goljer 2015-10-09 18:08:16 +02:00
parent b25eb27866
commit 2002900645

View file

@ -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 "\\(.+?\\)")