summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorArun Isaac2022-01-16 01:32:46 +0530
committerArun Isaac2022-01-16 12:24:45 +0530
commit95300bf9c4cee568fe9e51cae842a52098efe37f (patch)
treeb375af0a41a384f1c5ba9c91f7167eebb326735e /scripts
parent1b2c78475c41fb20ab2158a698a342ac60c154c3 (diff)
downloadccwl-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-xscripts/ccwl17
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