diff options
| author | Arun Isaac | 2025-11-27 14:52:01 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-11-27 14:52:01 +0000 |
| commit | 52dbe56b11914c27b2f2c8d155c00061b48e0f1e (patch) | |
| tree | 2c1db4bfcdb07af868c4ef1632bae9489213c572 | |
| parent | 24f722d39fc9b669554967ff6e74c99138d24261 (diff) | |
| download | ravanan-52dbe56b11914c27b2f2c8d155c00061b48e0f1e.tar.gz ravanan-52dbe56b11914c27b2f2c8d155c00061b48e0f1e.tar.lz ravanan-52dbe56b11914c27b2f2c8d155c00061b48e0f1e.zip | |
reader: Normalize all formals, not just File type formals.
| -rw-r--r-- | ravanan/reader.scm | 37 |
1 files 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." |
