Period errors reporting.
This commit is contained in:
parent
0d127e7200
commit
3c4ebedbb3
2 changed files with 32 additions and 15 deletions
|
@ -181,10 +181,19 @@
|
|||
;; list to periods.
|
||||
(define (convert-member-key:markers->periods m k)
|
||||
(if (dict-has-key? m k)
|
||||
(dict-set m k
|
||||
(period-markers->periods
|
||||
(let* ((res (period-markers->periods
|
||||
(sort-period-markers
|
||||
(dict-ref m k '()))))
|
||||
(ok? (car res))
|
||||
(periods (cadr res))
|
||||
(msg (caddr res))
|
||||
(line-number (cadddr res))
|
||||
(m1 (dict-set m k periods)))
|
||||
(if ok?
|
||||
m1
|
||||
(dict-set m1 member-file-error-symbol
|
||||
(cons (list line-number msg)
|
||||
(dict-ref m1 member-file-error-symbol '())))))
|
||||
m))
|
||||
|
||||
;; Converts all given keys using period-markers->periods.
|
||||
|
|
24
period.scm
24
period.scm
|
@ -65,23 +65,31 @@
|
|||
(ps '())
|
||||
(cb #f))
|
||||
(if (null? l)
|
||||
(list #t
|
||||
(if cb
|
||||
(reverse (cons (cons cb #f) ps))
|
||||
(reverse ps))
|
||||
(let ((m (car l))
|
||||
(rmt (if cb 'stop 'start)))
|
||||
(if (eq? (car m) rmt)
|
||||
""
|
||||
-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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue