aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/core/errors.nom6
-rw-r--r--nomsu_compiler.lua6
-rw-r--r--nomsu_compiler.moon6
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/core/errors.nom b/lib/core/errors.nom
index e1dd9d4..b1f1941 100644
--- a/lib/core/errors.nom
+++ b/lib/core/errors.nom
@@ -9,9 +9,9 @@ use "core/control_flow"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(fail $msg) compiles to ("
- at_1_fail(\(quote (this tree).source), 'Failure: \(
- "'..\($msg as lua expr)" if $msg else "A failure was triggered here'"
- ))
+ at_1_fail(\(quote (this tree).source),
+ \(($msg as lua expr) if $msg else (quote "A failure was triggered here'"))
+ )
")
(assume $condition) compiles to:
diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua
index d04c71f..0cedd50 100644
--- a/nomsu_compiler.lua
+++ b/nomsu_compiler.lua
@@ -26,15 +26,15 @@ fail_at = function(source, msg)
end
local title, err_msg, hint = msg:match("([^:]*):[ \n]+(.*)[ \n]+Hint: (.*)")
if not err_msg then
- err_msg, hint = msg:match("*(.*)[ \n]+Hint:[ \n]+(.*)")
- title = "Error"
+ err_msg, hint = msg:match("(.*)[ \n]+Hint:[ \n]+(.*)")
+ title = "Failure"
end
if not err_msg then
title, err_msg = msg:match("([^:]*):[ \n]+(.*)")
end
if not err_msg then
err_msg = msg
- title = "Error"
+ title = "Failure"
end
local err_str = pretty_error({
title = title,
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon
index 068173e..3993490 100644
--- a/nomsu_compiler.moon
+++ b/nomsu_compiler.moon
@@ -20,13 +20,13 @@ fail_at = (source, msg)->
title, err_msg, hint = msg\match("([^:]*):[ \n]+(.*)[ \n]+Hint: (.*)")
if not err_msg
- err_msg, hint = msg\match("*(.*)[ \n]+Hint:[ \n]+(.*)")
- title = "Error"
+ err_msg, hint = msg\match("(.*)[ \n]+Hint:[ \n]+(.*)")
+ title = "Failure"
if not err_msg
title, err_msg = msg\match("([^:]*):[ \n]+(.*)")
if not err_msg
err_msg = msg
- title = "Error"
+ title = "Failure"
err_str = pretty_error{
title: title,