aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang.lux')
-rw-r--r--new-luxc/source/luxc/lang.lux12
1 files changed, 12 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang.lux b/new-luxc/source/luxc/lang.lux
index 4aa47754a..b85409fb9 100644
--- a/new-luxc/source/luxc/lang.lux
+++ b/new-luxc/source/luxc/lang.lux
@@ -243,3 +243,15 @@
(if (n.= underflow idx)
output
(recur (n.dec idx) (format (|> (text;nth idx name) maybe;assume normalize-char) output)))))
+
+(exception: #export Error)
+
+(def: #export (with-error-tracking action)
+ (All [a] (-> (Meta a) (Meta a)))
+ (function [compiler]
+ (case (action compiler)
+ (#e;Error error)
+ ((throw Error error) compiler)
+
+ output
+ output)))