Fix period parsing, tests broken.

This commit is contained in:
Dominik Pantůček 2023-03-20 14:11:02 +01:00
parent 056644ff66
commit 700dd7cfd3

View file

@ -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