aboutsummaryrefslogtreecommitdiffstats
path: root/core/cell.moon
diff options
context:
space:
mode:
Diffstat (limited to 'core/cell.moon')
-rw-r--r--core/cell.moon5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/cell.moon b/core/cell.moon
index b7f4a1d..14bea2c 100644
--- a/core/cell.moon
+++ b/core/cell.moon
@@ -6,6 +6,7 @@
--
-- @classmod Cell
import Value from require 'core.value'
+import Error from require 'core.error'
import op_invoke, fn_invoke from require 'core.invoke'
import Tag from require 'core.tag'
@@ -69,7 +70,7 @@ class Cell
-- @tparam Scope scope the scope to evaluate in
-- @treturn Result the evaluation result
eval: (scope) =>
- head = assert @head!, "cannot evaluate expr without head"
+ head = assert @head!, Error 'syntax', "cannot evaluate empty expr"
head = (head\eval scope)\const!
Action = switch head.type
when 'opdef'
@@ -81,7 +82,7 @@ class Cell
when 'builtin'
head\unwrap!
else
- error "cannot evaluate expr with head #{head}"
+ error Error 'type', "#{head} is not an opdef, fndef or builtin"
Action\eval_cell @, scope, head