From 2002900645cf828b4d7303bfe79113ce3d03ca58 Mon Sep 17 00:00:00 2001 From: Matus Goljer Date: Fri, 9 Oct 2015 18:08:16 +0200 Subject: 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.) --- lisp/ledger-context.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') 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 "\\(.+?\\)") -- cgit v1.2.3