Skip to content

Commit 4d37a9e

Browse files
.{
1 parent 6b6d627 commit 4d37a9e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

asm.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ast import Cursor, Expr, Token # type: ignore
1+
from ast import Assignment, Cursor, Expr, Identifier, Lambda, Token # type: ignore
22

33

44
class ASM(Cursor):
@@ -8,5 +8,11 @@ def __init__(self, input: list[Expr]) -> None:
88

99
def generate(self) -> None:
1010
c_expr = self.current()
11+
if isinstance(c_expr, Assignment) and isinstance(c_expr.left, Identifier):
12+
name = c_expr.left.value
13+
if isinstance(c_expr.right, Lambda):
14+
print(f"Handling lambda assignment {c_expr.left}.")
15+
self.lines.append(f"{name}:")
16+
return None
1117
print(f"!! {c_expr}")
1218
return None

boot.dal

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
return_float\ x int :: Float → 2.32
1+
// return_float\ x int :: float → 2.32
2+
return_int\ x int :: int → 2
23

34
// Who is whatever and why are we doing them...?
45

5-
do_whatever\ :: (float, int) → (3.32, 54)
6+
// do_whatever\ :: (float, int) → (3.32, 54)
7+
main\ :: int → return_int(2)

0 commit comments

Comments
 (0)