From 1345e9492207629430df3fd4951a1c403b39946a Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 17 Nov 2023 23:48:50 +0000 Subject: ccwl: Report errors in rename mappings. * ccwl/ccwl.scm (collect-steps): Report errors in rename mappings. --- ccwl/ccwl.scm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index 11d6d05..3bf2644 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -596,9 +596,19 @@ represented by objects." (values (map (lambda (key) (or (any (match-lambda ((new . old) - (and (eq? old (key-name key)) - (set-key-name key (keyword->symbol new))))) - (syntax->datum (pairify #'(mapping ...)))) + (unless (keyword? (syntax->datum new)) + (raise-exception + (condition (ccwl-violation new) + (formatted-message "Expected keyword (for example: #:foo, #:bar)")))) + (unless (symbol? (syntax->datum old)) + (raise-exception + (condition (ccwl-violation old) + (formatted-message "Unknown key ~a. Known keys at this step are ~a." + (syntax->datum old) + (map key-name input-keys))))) + (and (eq? (syntax->datum old) (key-name key)) + (set-key-name key (keyword->symbol (syntax->datum new)))))) + (pairify #'(mapping ...))) key)) input-keys) (list))) -- cgit v1.2.3