aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/statement.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/statement.jvm.lux12
1 files changed, 7 insertions, 5 deletions
diff --git a/new-luxc/source/luxc/lang/translation/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/statement.jvm.lux
index feb64c293..2a2173fa9 100644
--- a/new-luxc/source/luxc/lang/translation/statement.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/statement.jvm.lux
@@ -21,6 +21,7 @@
[";T" common]))))
(exception: #export Invalid-Definition-Value)
+(exception: #export Cannot-Evaluate-Definition)
(host;import java.lang.Object
(toString [] String))
@@ -56,13 +57,16 @@
[field (Class.getField [commonT;value-field] class)]
(Field.get [#;None] field))
(#e;Success #;None)
- (&;throw Invalid-Definition-Value (format current-module ";" def-name))
+ (&;throw Invalid-Definition-Value (%ident [current-module def-name]))
(#e;Success (#;Some valueV))
(wrap valueV)
(#e;Error error)
- (&;fail error)))
+ (&;throw Cannot-Evaluate-Definition
+ (format "Definition: " (%ident [current-module def-name]) "\n"
+ "Error:\n"
+ error))))
_ (&module;define [current-module def-name] [valueT metaV valueV])
_ (if (meta;type? metaV)
(case (meta;declared-tags metaV)
@@ -77,6 +81,4 @@
(def: #export (translate-program program-args programI)
(-> Text $;Inst (Meta Unit))
- (do meta;Monad<Meta>
- []
- (&;fail "'lux program' is unimplemented.")))
+ (&;fail "\"lux program\" is unimplemented."))