Skip to content

Commit

Permalink
closing atoms is bugged
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-johnson-4 committed Jan 2, 2024
1 parent 677e476 commit c668eeb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions stdlib/helpers.lm
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
::yield-cons := λhead tail. (
head # this is head
::close-this
\t mov %r8, %r9 \n # %r9 is head
\t mov %r8, %rax \n # %rax is head

tail # this is tail
::close-this # %r8 is tail

\t mov $0, %r12 \n # this.atom is NULL
\t mov %r9, %r13 \n # this.head is head
\t mov %rax, %r13 \n # this.head is head
\t mov %r8, %r14 \n # this.tail is tail
\t mov $0, %r15 \n # this.flags is 0
);
Expand Down
7 changes: 0 additions & 7 deletions stdlib/prelude.lm
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,17 @@
\t cmp $0, %r14 \n
\t je __print_this_nil \n

::show-cons
::push-this
::pop-this
::show-cons

# print head
::push-this
\t mov %r13, %r8 \n
::open-this
::show-cons
\t call __print_this \n
::pop-this

# print tail
::push-this
\t mov %r14, %r8 \n
::open-this
::show-cons
\t call __print_this \n
::pop-this

Expand Down
2 changes: 1 addition & 1 deletion tests/cons.lm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

main := (
print-s (() ())
print-s (() 123)
# print-s (123 () 456)
);

0 comments on commit c668eeb

Please sign in to comment.