Innocenty Enikeew před 8 roky
rodič
revize
9491a7158a
2 změnil soubory, kde provedl 8 přidání a 8 odebrání
  1. 1 0
      package.lisp
  2. 7 8
      pta-ledger.lisp

+ 1 - 0
package.lisp

@@ -2,6 +2,7 @@
   (:use #:cl #:smug)
   (:export #:parse-journal
            #:parse-query
+           #:entries
            #:balance
            #:format-balance))
 

+ 7 - 8
pta-ledger.lisp

@@ -1,7 +1,14 @@
 (in-package #:pta-ledger)
 
+(defstruct amount quantity commodity)
+(defstruct posting
+  status account amount unit-price total-price comment)
+(defstruct entry
+  date secondary-date status code description comment postings)
+
 (defvar *default-year* nil "Initialized to current year on parsing start. Could be set with directive")
 (defvar *default-commodity* "RUB" "Could be set with directive")
+
 (defparameter +day+ (* 60 60 24) "day in seconds")
 (defun get-date (universal-time)
   (nreverse (subseq (multiple-value-list (decode-universal-time universal-time)) 3 6)))
@@ -151,8 +158,6 @@
                (.until (.char= #\") :result-type 'string)
                (.char= #\"))))
 
-(defstruct amount quantity commodity)
-
 (defun .amount ()
   (.or
    (.let* ((sign1 (.optional (.chars #\- #\+)))
@@ -177,9 +182,6 @@
                                  quantity)
                    :commodity commodity)))))
 
-(defstruct posting
-  status account amount unit-price total-price comment)
-
 (defun .posting ()
   (.let* ((_ (.whitespace))
           (status (.optional (.prog1 (.status) (.optional (.spaces)))))
@@ -207,9 +209,6 @@
                     :comment (when (or comment comments)
                                (format nil "~{~A~^~%~}" (remove nil (list* comment comments)))))))))
 
-(defstruct entry
-  date secondary-date status code description comment postings)
-
 (defun .entry ()
   (.let* ((date (.simple-date))
           (secondary-date (.optional (.progn (.char= #\=)