Fix period parsing, tests broken.
This commit is contained in:
parent
056644ff66
commit
700dd7cfd3
1 changed files with 6 additions and 3 deletions
|
@ -56,28 +56,31 @@
|
|||
(define (sort-period-markers l)
|
||||
(sort l
|
||||
(lambda (a b)
|
||||
(month<? (cdr a) (cdr b)))))
|
||||
(month<? (cadr a) (cadr b)))))
|
||||
|
||||
;; Converts list of start/stop markers to list of pairs of months -
|
||||
;; periods.
|
||||
(define (period-markers->periods l)
|
||||
(print "===")
|
||||
(let loop ((l l)
|
||||
(ps '())
|
||||
(cb #f))
|
||||
(print l)
|
||||
(if (null? l)
|
||||
(if cb
|
||||
(reverse (cons (cons cb #f) ps))
|
||||
(reverse ps))
|
||||
(let ((m (car l))
|
||||
(rmt (if cb 'stop 'start)))
|
||||
(print " m: " m)
|
||||
(if (eq? (car m) rmt)
|
||||
(if cb
|
||||
(loop (cdr l)
|
||||
(cons (cons cb (cdr m)) ps)
|
||||
(cons (cons cb (cadr m)) ps)
|
||||
#f)
|
||||
(loop (cdr l)
|
||||
ps
|
||||
(cdr m)))
|
||||
(cadr m)))
|
||||
(if (eq? (*member-file-check-syntax*) 'error)
|
||||
(error 'period-markers->periods "Invalid start/stop sequence marker" m)
|
||||
(reverse ps) ; Just ignore it for now
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue