aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-04-22 21:27:13 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-04-22 21:27:13 +0200
commit574c9ddbf0c922cee4530c21633b77d0857ead01 (patch)
tree3bf5a94b09951c6b1f9cdc98aec822e3bf675a9c
parentICAL Change to new tz source. (diff)
downloadcalp-574c9ddbf0c922cee4530c21633b77d0857ead01.tar.gz
calp-574c9ddbf0c922cee4530c21633b77d0857ead01.tar.xz
Improve error reporting on recurrence parse.
-rw-r--r--module/vcomponent/recurrence/parse.scm13
1 files changed, 9 insertions, 4 deletions
diff --git a/module/vcomponent/recurrence/parse.scm b/module/vcomponent/recurrence/parse.scm
index b044aae1..a4f86942 100644
--- a/module/vcomponent/recurrence/parse.scm
+++ b/module/vcomponent/recurrence/parse.scm
@@ -53,7 +53,9 @@
((key guard '=> body ...)
`((,key) (if (not ,guard)
(begin (warning (quote ,key)
- (quote ,guard))
+ (quote ,guard)
+ (list ,@guard)
+ )
,@else-clause)
(begin ,@body))))
((key body ...)
@@ -62,11 +64,14 @@
`(else ,@body)))
cases))))
-(define (warning key guard )
- (display (format #f "Warning RRULE guard failed for key ~a~% guard: ~a~%"
- key guard)
+(define (warning key guard extra)
+ (display (format #f "Warning RRULE guard failed for key ~a~% guard: ~a : ~s~%"
+ key guard (map (lambda (o) (if (procedure? o)
+ (procedure-name o)
+ o)) extra))
(current-error-port)))
+
;; RFC 5545, Section 3.3.10. Recurrence Rule, states that the UNTIL value MUST have
;; the same type as the DTSTART of the event (date or datetime). I have seen events
;; in the wild which didn't follow this. I consider that an user error.