Skip to content

Commit

Permalink
fix fib example
Browse files Browse the repository at this point in the history
  • Loading branch information
yeti0904 committed Oct 23, 2024
1 parent 1d21c76 commit 2db6ed4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions examples/fib.cal
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
include "cores/select.cal"
include "std/io.cal"

func fib begin
let cell n
-> n

func fib cell n -> cell res begin
if n 1 <= then
n return
else
Expand Down
4 changes: 3 additions & 1 deletion source/backends/lua.d
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,9 @@ class BackendLua : CompilerBackend {
output ~= format("func__%s()\n", node.func.Sanitise());
}

output ~= "dspBackup = mem[vsp]\n";
output ~= "dspBackup = mem[vsp]\n"; // TODO:
// this is TERRIBLE
// if you try/catch a function with a try/catch inside of it then it all breaks
output ~= "vsp = vsp + 1\n";

++ blockCounter;
Expand Down

0 comments on commit 2db6ed4

Please sign in to comment.