From 52dbe56b11914c27b2f2c8d155c00061b48e0f1e Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 27 Nov 2025 14:52:01 +0000 Subject: reader: Normalize all formals, not just File type formals. --- ravanan/reader.scm | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/ravanan/reader.scm b/ravanan/reader.scm index c30aa9f..e7b0598 100644 --- a/ravanan/reader.scm +++ b/ravanan/reader.scm @@ -156,35 +156,24 @@ the @code{required} field when it is not specified." (vector `(("pattern" . ,secondary-files) ("required" . ,default-required)))))) -(define (some-file-type? type) - "Return @code{#t} if @var{type} is a @code{File}, an array of @code{File}s, an -array of array of @code{File}s, etc. Else, return @code{#f}" - (or (eq? type 'File) - (and (cwl-array-type? type) - (some-file-type? (cwl-array-type-subtype type))))) - (define (normalize-formal-input input) "Normalize formal @var{input}." - (if (some-file-type? (formal-parameter-type (assoc-ref input "type"))) - (maybe-assoc-set input - (cons "default" - (maybe-bind (maybe-assoc-ref (just input) "default") - (compose just normalize-input))) - (cons "secondaryFiles" - (maybe-bind (maybe-assoc-ref (just input) "secondaryFiles") - (compose just - (cut normalize-secondary-files <> #t))))) - input)) + (maybe-assoc-set input + (cons "default" + (maybe-bind (maybe-assoc-ref (just input) "default") + (compose just normalize-input))) + (cons "secondaryFiles" + (maybe-bind (maybe-assoc-ref (just input) "secondaryFiles") + (compose just + (cut normalize-secondary-files <> #t)))))) (define (normalize-formal-output output) "Normalize formal @var{output}." - (if (some-file-type? (formal-parameter-type (assoc-ref output "type"))) - (maybe-assoc-set output - (cons "secondaryFiles" - (maybe-bind (maybe-assoc-ref (just output) "secondaryFiles") - (compose just - (cut normalize-secondary-files <> #f))))) - output)) + (maybe-assoc-set output + (cons "secondaryFiles" + (maybe-bind (maybe-assoc-ref (just output) "secondaryFiles") + (compose just + (cut normalize-secondary-files <> #f)))))) (define (normalize-base-command maybe-base-command) "Normalize @var{base-command} of @code{CommandLineTool} class workflow." -- cgit 1.4.1