aboutsummaryrefslogtreecommitdiff
path: root/ccwl
diff options
context:
space:
mode:
authorArun Isaac2023-10-16 17:32:57 +0100
committerArun Isaac2023-10-16 17:32:57 +0100
commitbc6bc78ac3079822dcd5bc51e36983a7470fdc04 (patch)
tree1ef23f4c16adbec7d03f3185e27fb7e217bf0cc0 /ccwl
parent7cc6abe4b5d1af4a05a58705279f6172cf270825 (diff)
downloadccwl-bc6bc78ac3079822dcd5bc51e36983a7470fdc04.tar.gz
ccwl-bc6bc78ac3079822dcd5bc51e36983a7470fdc04.tar.lz
ccwl-bc6bc78ac3079822dcd5bc51e36983a7470fdc04.zip
ccwl: Error out on prefixes that are not strings.
* ccwl/ccwl.scm (run-args): Error out on prefixes that are not strings. * tests/ccwl.scm ("command definitions with non-string prefixes in prefixed inputs must raise a &ccwl-violation condition"): New test.
Diffstat (limited to 'ccwl')
-rw-r--r--ccwl/ccwl.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index a476406..f9243aa 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -307,6 +307,12 @@ identifiers defined in the commands."
((prefix string-arg) (and (string? (syntax->datum #'prefix))
(string? (syntax->datum #'string-arg)))
(list #'prefix #'string-arg))
+ ;; Prefixes that are not strings
+ ((prefix _)
+ (raise-exception
+ (condition (ccwl-violation #'prefix)
+ (formatted-message "Invalid prefix ~a. Prefixes must be strings."
+ (syntax->datum #'prefix)))))
(_
(raise-exception
(condition (ccwl-violation x)