aboutsummaryrefslogtreecommitdiff
path: root/snug-clean/src/Snug/Compile/ABI.dcl
diff options
context:
space:
mode:
authorCamil Staps2023-11-29 11:26:28 +0100
committerCamil Staps2023-11-29 11:26:28 +0100
commit4ce6adb6f5dc6623b903853322be726a9f95a3b8 (patch)
tree927447752dcf46f491be81eabbd68a5d5e06ffa8 /snug-clean/src/Snug/Compile/ABI.dcl
parentWIP on code generation for case expressions (diff)
Continue with cases WIP: todo is matching code for basic values and adding locals for constructor arguments in a patterncases
Diffstat (limited to 'snug-clean/src/Snug/Compile/ABI.dcl')
-rw-r--r--snug-clean/src/Snug/Compile/ABI.dcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/snug-clean/src/Snug/Compile/ABI.dcl b/snug-clean/src/Snug/Compile/ABI.dcl
index c7fe7ad..7d3a63a 100644
--- a/snug-clean/src/Snug/Compile/ABI.dcl
+++ b/snug-clean/src/Snug/Compile/ABI.dcl
@@ -1,5 +1,11 @@
definition module Snug.Compile.ABI
+from StdBool import not, &&
+from StdClass import class Ord(<=)
+from StdInt import instance < Int
+from StdMisc import abort
+from StdOverloaded import class <(<)
+
from MIPS.MIPS32 import :: Label, :: Register(GP,S,T)
from Snug.Compile import :: Namespace
from Snug.Syntax import :: ConstructorIdent, :: SymbolIdent
@@ -17,7 +23,7 @@ TextEndDataStart :== S 7
HeapPtr :== GP
-TempImm :== T 0
+TempImm i :== if (0 <= i && i <= 1) (T i) (abort "TempImm out of range\n")
constructorLabel :: !Namespace !ConstructorIdent -> Label
functionLabel :: !Namespace !EntryPoint !SymbolIdent -> Label