summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-29 20:52:21 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-29 20:52:21 -0400
commitc6d1d76749da2fb3996da64b6a86a572dd2c8f48 (patch)
tree9bf622cbce25f71c245b5543a28ea938b21e95b1
parent62f45066f76ff51a79a48699867f1f8534f0cc3c (diff)
Get full stack trace for errors handling a function's result
-rw-r--r--singeli.bqn8
1 files changed, 4 insertions, 4 deletions
diff --git a/singeli.bqn b/singeli.bqn
index d7fbf4e..b712af0 100644
--- a/singeli.bqn
+++ b/singeli.bqn
@@ -603,11 +603,11 @@ functions ← {kname⇐"function"
Finish⇐{"Explicit result type needed"!IsTyped 𝕩⋄SetRtype TypeOf 𝕩⋄𝕩} _ret_ 0
Prot⇐{𝕤⋄ 1↓∾" "⊸∾¨⟨shows,Show rType⟩∾(•Repr∘≠⊸∾Show¨args)}
}
- _with ⇐ {
+ _with_ ⇐ {
fs←current
f←current↩program.AddFunction new
{𝕩.Set f} 𝕨 # Passed in by nodes.Define, pretty hacky
- f.Finish f 𝔽 𝕩
+ f (f.Finish 𝔽)program._trace_ 𝕘 𝕩
current↩fs
f
}
@@ -942,11 +942,11 @@ nodes ← {
⟨node,Dump,Disp,Oper⟩⇐Defaults "function"‿visit
Scope⇐{ Visit scopes._defer o.Scope scopes.New 𝕩 }
Eval⇐{
- Ev←(o.Eval args env.New 𝕩) program._trace_ pos
+ ev←o.Eval args env.New 𝕩
Ev¨ args
𝕨.SetRType∘Ev¨ type
Ev result
- }functions._with
+ } functions._with_ pos
}
_setType ← { pos type‿env _𝕣 v:
{ ≠type ?