aboutsummaryrefslogtreecommitdiff
path: root/core/errors.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-08 15:23:22 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-08 15:24:15 -0800
commit652c29bdef1f0991cc13bef59d6dc78b657ae9a4 (patch)
tree8e335399e77b1893657b9fa985db0738034daac3 /core/errors.nom
parent1f3660f393c1a17988a15b89f18686b28e51a9e7 (diff)
Major overhaul, splitting nomsu_compiler into nomsu_environment,
nomsu_compiler, and nomsu_decompiler. Also added comprehensions.
Diffstat (limited to 'core/errors.nom')
-rw-r--r--core/errors.nom6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/errors.nom b/core/errors.nom
index 0b0a6a3..74c0a54 100644
--- a/core/errors.nom
+++ b/core/errors.nom
@@ -4,6 +4,8 @@
use "core/metaprogramming.nom"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
(barf %msg) compiles to (Lua "error(\(=lua "\%msg and \(%msg as lua expr) or 'nil'"), 0);")
(compile error at %tree %msg) compiles to (..)
Lua "nomsu:compile_error(\(%tree as lua expr), \(%msg as lua expr))"
@@ -12,7 +14,7 @@ use "core/metaprogramming.nom"
(assume %condition) compiles to:
lua> "\
- ..local \%assumption = 'Assumption failed: '..tostring(nomsu:tree_to_nomsu(\%condition))"
+ ..local \%assumption = 'Assumption failed: '..tostring((\%condition):get_source_code())"
return (..)
Lua "\
..if not \(%condition as lua expr) then
@@ -21,7 +23,7 @@ use "core/metaprogramming.nom"
(assume %a == %b) compiles to:
lua> "\
- ..local \%assumption = 'Assumption failed: '..tostring(nomsu:tree_to_nomsu(\(\(%a == %b))))"
+ ..local \%assumption = 'Assumption failed: '..tostring(\(\(%a == %b) as nomsu))"
define mangler
return (..)
Lua "\