diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-03-20 20:07:37 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-03-20 20:08:25 +0000 |
| commit | 04eb8afc8367e51c15c507740b2c55fce2569b0d (patch) | |
| tree | 01c5a53fbcd72d9a05009792126af5c54c8486ae /core/invoke.moon | |
| parent | docs/index: mention license + repo (diff) | |
| download | alive-04eb8afc8367e51c15c507740b2c55fce2569b0d.tar.gz alive-04eb8afc8367e51c15c507740b2c55fce2569b0d.zip | |
language Error tracking
Close #3
Diffstat (limited to 'core/invoke.moon')
| -rw-r--r-- | core/invoke.moon | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/invoke.moon b/core/invoke.moon index 736f284..97d3949 100644 --- a/core/invoke.moon +++ b/core/invoke.moon @@ -6,6 +6,7 @@ import Value from require 'core.value' import Result from require 'core.result' import Action from require 'core.base' import Scope from require 'core.scope' +import Error from require 'core.error' --- `Action` implementation that invokes an `Op`. -- @@ -40,7 +41,7 @@ class op_invoke extends Action -- @treturn Result eval: (scope, tail) => children = [L\push expr\eval, scope for expr in *tail] - @op\setup [result for result in *children], scope + Error.wrap "invoking #{@op}#{@tag}", @op\setup, [result for result in *children], scope any_dirty = false for input in @op\all_inputs! @@ -91,8 +92,8 @@ class fn_invoke extends Action with L\push tail[i]\eval, outer_scope fn_scope\set name, \make_ref! - body = body\clone @tag - result = body\eval fn_scope + clone = body\clone @tag + result = Error.wrap "invoking function #{body.tag} at #{@tag}", clone\eval, fn_scope table.insert children, result Result :children, value: result.value |
