diff options
author | Arun Isaac | 2022-01-16 01:32:46 +0530 |
---|---|---|
committer | Arun Isaac | 2022-01-16 12:24:45 +0530 |
commit | 95300bf9c4cee568fe9e51cae842a52098efe37f (patch) | |
tree | b375af0a41a384f1c5ba9c91f7167eebb326735e /scripts | |
parent | 1b2c78475c41fb20ab2158a698a342ac60c154c3 (diff) | |
download | ccwl-95300bf9c4cee568fe9e51cae842a52098efe37f.tar.gz ccwl-95300bf9c4cee568fe9e51cae842a52098efe37f.tar.lz ccwl-95300bf9c4cee568fe9e51cae842a52098efe37f.zip |
scripts: Report ccwl syntax violations.
* ccwl/ui.scm: New file.
* scripts/ccwl: Import (rnrs exceptions), (srfi srfi-28), (ccwl
conditions) and (ccwl ui).
(main): Handle ccwl syntax violations by reporting them and exiting.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/ccwl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/ccwl b/scripts/ccwl index 63a929a..1215486 100755 --- a/scripts/ccwl +++ b/scripts/ccwl @@ -24,12 +24,15 @@ ;;; Code: -(use-modules (srfi srfi-28) +(use-modules (rnrs exceptions) + (srfi srfi-28) (srfi srfi-37) (ice-9 match) (ccwl ccwl) + (ccwl conditions) (ccwl cwl) - (ccwl graphviz)) + (ccwl graphviz) + (ccwl ui)) (define (invalid-option opt name arg result) (error "Invalid option" name)) @@ -84,8 +87,14 @@ Compile SOURCE-FILE. ((cond ((string=? to "cwl") workflow->cwl) ((string=? to "dot") workflow->dot)) - (load (canonicalize-path (assq-ref args 'source-file)) - read-syntax) + (guard (exception + ;; Handle syntax violation exceptions by reporting + ;; them and exiting. + ((ccwl-violation? exception) + (report-ccwl-violation exception) + (exit #f))) + (load (canonicalize-path (assq-ref args 'source-file)) + read-syntax)) (current-output-port))))) ((program args ...) (let ((args (args-fold args |