Period errors reporting.

This commit is contained in:
Dominik Pantůček 2023-03-20 14:55:37 +01:00
parent 0d127e7200
commit 3c4ebedbb3
2 changed files with 32 additions and 15 deletions

View file

@ -65,23 +65,31 @@
(ps '())
(cb #f))
(if (null? l)
(if cb
(reverse (cons (cons cb #f) ps))
(reverse ps))
(let ((m (car l))
(rmt (if cb 'stop 'start)))
(if (eq? (car m) rmt)
(list #t
(if cb
(reverse (cons (cons cb #f) ps))
(reverse ps))
""
-1)
(let* ((marker (car l))
(rmt (if cb 'stop 'start))
(mtype (car marker))
(month (cadr marker))
(line-number (caddr marker)))
(if (eq? mtype rmt)
(if cb
(loop (cdr l)
(cons (cons cb (cadr m)) ps)
(cons (cons cb month) ps)
#f)
(loop (cdr l)
ps
(cadr m)))
month))
(if (eq? (*member-file-check-syntax*) 'error)
(error 'period-markers->periods "Invalid start/stop sequence marker" m)
(reverse ps) ; Just ignore it for now
))))))
(error 'period-markers->periods "Invalid start/stop sequence marker" marker)
(list #f
(reverse ps)
(sprintf "Invalid start/stop sequence marker ~A" marker)
line-number)))))))
;; Returns duration of period in months. Start is included, end is
;; not. The period contains the month just before the specified end.