summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ledger-context.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/ledger-context.el b/lisp/ledger-context.el
index 893fdbac..7b10c552 100644
--- a/lisp/ledger-context.el
+++ b/lisp/ledger-context.el
@@ -33,10 +33,11 @@
;; elements
(defconst ledger-indent-string "\\(^[ \t]+\\)")
(defconst ledger-status-string "\\([*! ]?\\)")
-(defconst ledger-account-string "[\\[(]?\\(.*?\\)[])]? ")
-(defconst ledger-amount-string "[ \t]?\\(-?[0-9]+[\\.,][0-9]*\\)")
+(defconst ledger-account-string "[\\[(]?\\(.*?\\)[])]?")
+(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-nil-string "\\([ \t]\\)")
(defconst ledger-commodity-string "\\(.+?\\)")
(defconst ledger-date-string "^\\([0-9]\\{4\\}[/-][01]?[0-9][/-][0123]?[0-9]\\)")
(defconst ledger-code-string "\\((.*)\\)?")
@@ -57,12 +58,12 @@
(ledger-single-line-config date nil status nil code nil payee)
(ledger-single-line-config date nil status nil payee)))
(list 'acct-transaction (list (ledger-single-line-config indent comment)
- (ledger-single-line-config indent status account nil commodity amount nil comment)
- (ledger-single-line-config indent status account nil commodity amount)
- (ledger-single-line-config indent status account nil amount nil commodity comment)
- (ledger-single-line-config indent status account nil amount nil commodity)
- (ledger-single-line-config indent status account nil amount)
- (ledger-single-line-config indent status account nil comment)
+ (ledger-single-line-config indent status account separator commodity amount nil comment)
+ (ledger-single-line-config indent status account separator commodity amount)
+ (ledger-single-line-config indent status account separator amount nil commodity comment)
+ (ledger-single-line-config indent status account separator amount nil commodity)
+ (ledger-single-line-config indent status account separator amount)
+ (ledger-single-line-config indent status account separator comment)
(ledger-single-line-config indent status account)))))
(defun ledger-extract-context-info (line-type pos)