diff options
| author | Arun Isaac | 2026-06-24 22:07:54 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-06-24 22:08:52 +0100 |
| commit | cefbe4d5e164cd0caf70a4df5a2bb6f4c12db641 (patch) | |
| tree | 6333e35910c965b78de245b3ffdf9e99477146f5 | |
| parent | 596e868c145d8c0c3f5ad3893e32d5dc73151bc4 (diff) | |
| download | ccwl-cefbe4d5e164cd0caf70a4df5a2bb6f4c12db641.tar.gz ccwl-cefbe4d5e164cd0caf70a4df5a2bb6f4c12db641.tar.lz ccwl-cefbe4d5e164cd0caf70a4df5a2bb6f4c12db641.zip | |
ccwl: Replace invalid #:separate? flags with #f.
When the exception is continued, we don't want invalid #:separate? flags leaking in; replace them with #f.
| -rw-r--r-- | ccwl/ccwl.scm | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index d14cdad..cafc3c5 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -387,12 +387,17 @@ input, return #f." (_ #f))) (define (validate-separate? separate?) - "Validate @var{separate?} and raise an exception if it is not valid." - (unless (boolean? separate?) - (raise-continuable - (condition (ccwl-violation separate?) - (formatted-message "Invalid #:separate? flag ~a. #:separate? flag must be a boolean." - (syntax->datum separate?)))))) + "Validate @var{separate?} and raise a continuable exception if it is +not valid. Return validated @var{separate?}---either @code{#'#t} or +@code{#'#f}." + (if (boolean? (syntax->datum separate?)) + separate? + (begin + (raise-continuable + (condition (ccwl-violation separate?) + (formatted-message "Invalid #:separate? flag ~a. #:separate? flag must be a boolean." + (syntax->datum separate?)))) + #'#f))) (define (run-arg-separate? run-arg) "Return the separate? specified in @var{run-arg} syntax. If not a @@ -400,8 +405,7 @@ prefixed input, return #f." (syntax-case run-arg (array) ((prefix _ args ...) (string? (syntax->datum #'prefix)) (apply (syntax-lambda** (#:key (separate? #'#t)) - (validate-separate? (syntax->datum separate?)) - separate?) + (validate-separate? separate?)) #'(args ...))) (_ #f))) @@ -453,8 +457,7 @@ identifiers defined in the commands." ((prefix string-arg args ...) (and (string? (syntax->datum #'prefix)) (string? (syntax->datum #'string-arg))) (apply (syntax-lambda** (#:key (separate? #'#t)) - (validate-separate? (syntax->datum separate?)) - (if (syntax->datum separate?) + (if (syntax->datum (validate-separate? separate?)) (list #'prefix #'string-arg) (list #`#,(string-append (syntax->datum #'prefix) (syntax->datum #'string-arg))))) |
