about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-12-19 14:42:35 +0000
committerArun Isaac2025-12-19 20:13:39 +0000
commit8f3be3ac0a39d9043d09ca3ae415d3f33587ad11 (patch)
treedeef1ecc4d7a0ae35225204333a88836d253cc50
parent449a75c9e067d383ed41309c6ac33416a2066f88 (diff)
downloadccwl-8f3be3ac0a39d9043d09ca3ae415d3f33587ad11.tar.gz
ccwl-8f3be3ac0a39d9043d09ca3ae415d3f33587ad11.tar.lz
ccwl-8f3be3ac0a39d9043d09ca3ae415d3f33587ad11.zip
ccwl: Allow prefixed arguments to have additional keyword arguments.
This will allow us to add additional qualifiers such as #:separate?.
-rw-r--r--ccwl/ccwl.scm17
1 files changed, 9 insertions, 8 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm
index cee6001..07797fa 100644
--- a/ccwl/ccwl.scm
+++ b/ccwl/ccwl.scm
@@ -351,13 +351,13 @@ return @code{#f}."
                    (input (identifier? #'input)
                           (syntax->datum #'input))
                    ;; prefixed input
-                   ((_ input) (identifier? #'input)
+                   ((_ input _ ...) (identifier? #'input)
                     (syntax->datum #'input))
                    ;; array input specifier
                    ((array input _ ...) (identifier? #'input)
                     (syntax->datum #'input))
                    ;; prefixed array input specifier
-                   ((_ (array input _ ...)) (identifier? #'input)
+                   ((_ (array input _ ...) _ ...) (identifier? #'input)
                     (syntax->datum #'input))
                    (_ #f))))
             (and run-arg-input
@@ -368,7 +368,8 @@ return @code{#f}."
   "Return the prefix specified in @var{run-arg} syntax. If not a prefixed
 input, return #f."
   (syntax-case run-arg ()
-    ((prefix _) #'prefix)
+    ((prefix _ ...) (string? (syntax->datum #'prefix))
+     #'prefix)
     (_ #f)))
 
 (define (run-arg-separator run-arg)
@@ -386,7 +387,7 @@ input, return #f."
                 separator))
             #'(args ...)))
     ;; prefixed array input specifier
-    ((_ (array input args ...))
+    ((_ (array input args ...) _ ...)
      (run-arg-separator #'(array input args ...)))
     (_ #f)))
 
@@ -416,14 +417,14 @@ identifiers defined in the commands."
        (syntax->run-arg #'input))
       ;; Flatten prefixed string arguments. They have no
       ;; special meaning.
-      ((prefix string-arg) (and (string? (syntax->datum #'prefix))
-                                (string? (syntax->datum #'string-arg)))
+      ((prefix string-arg _ ...) (and (string? (syntax->datum #'prefix))
+                                      (string? (syntax->datum #'string-arg)))
        (list #'prefix #'string-arg))
       ;; Recurse on prefixed inputs.
-      ((prefix input) (string? (syntax->datum #'prefix))
+      ((prefix input _ ...) (string? (syntax->datum #'prefix))
        (syntax->run-arg #'input))
       ;; Prefixes that are not strings
-      ((prefix _)
+      ((prefix _ ...)
        (raise-exception
         (condition (ccwl-violation #'prefix)
                    (formatted-message "Invalid prefix ~a. Prefixes must be strings."