aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-01 23:12:43 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-01 23:12:43 +0100
commit27a34865830adff82f8ef8bf76975480504275d4 (patch)
tree9bc2817e18265b0c1ae736ae5742e8bde03c6eaa /module/vcomponent
parentAdd rudementary dark theme. (diff)
downloadcalp-27a34865830adff82f8ef8bf76975480504275d4.tar.gz
calp-27a34865830adff82f8ef8bf76975480504275d4.tar.xz
Made escaped non-escapable characters non-fatal in parser.
Diffstat (limited to 'module/vcomponent')
-rw-r--r--module/vcomponent/parse.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm
index 821e2d92..1a643fa3 100644
--- a/module/vcomponent/parse.scm
+++ b/module/vcomponent/parse.scm
@@ -91,6 +91,19 @@
(let ((component (make-vcomponent))
(ctx (make-parse-ctx (port-filename port)))
(strbuf (make-strbuf)))
+ (define (warning fmt . args)
+ (display
+ (format #f
+ "== PARSE WARNING ==
+filename = ~a
+row ~a column ~a ctx = ~a
+~a ; ~a = ... : ...
+~?~%~%"
+ (get-filename ctx)
+ (get-row ctx) (get-col ctx) (get-ctx ctx)
+ (get-line-key ctx) (get-param-key ctx)
+ fmt args)) )
+
(with-throw-handler #t
(lambda ()
(while #t
@@ -206,7 +219,7 @@
[(#\n #\N) (strbuf-append! strbuf (char->integer #\newline))]
[(#\; #\, #\\) => (lambda (c) (strbuf-append! strbuf (char->integer c)))]
- [else => (lambda (c) (throw 'escape-error "Non-escapable character" c))])
+ [else => (lambda (c) (warning "Non-escapable character: ~a" c))])
(increment-column! ctx)]
;; Delimiter between param key and param value