summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-11-17 23:48:50 +0000
committerArun Isaac2023-11-17 23:48:50 +0000
commit1345e9492207629430df3fd4951a1c403b39946a (patch)
tree7521318fd8366f50d82e667082ff1ac3de636a77
parent6842628dc5345b47ca7ce99ea5eba119cd5741e6 (diff)
downloadccwl-1345e9492207629430df3fd4951a1c403b39946a.tar.gz
ccwl-1345e9492207629430df3fd4951a1c403b39946a.tar.lz
ccwl-1345e9492207629430df3fd4951a1c403b39946a.zip
ccwl: Report errors in rename mappings.
* ccwl/ccwl.scm (collect-steps): Report errors in rename mappings.
-rw-r--r--ccwl/ccwl.scm16
1 files 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 <step> 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)))