blob: d329156deacb20cd69763987db5d7376ca70c6c3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
definition module Snug.Compile
from Data.Map import :: Map
from MIPS.MIPS32 import :: Line
from Snug.Syntax import :: ConstructorDef, :: ConstructorIdent, :: Definition,
:: SymbolIdent, :: Type
:: Namespace :== String
:: Namespaced id =
{ ns :: !Namespace
, id :: !id
}
:: Globals =
{ constructors :: !Map (Namespaced ConstructorIdent) ConstructorDef
, functions :: !Map (Namespaced SymbolIdent) FunctionInfo
}
:: FunctionInfo =
{ arity :: !Int
, type :: !Type
}
compile :: !Namespace ![Definition] -> [Line]
compileDefinition :: !Namespace !Globals !Definition -> [Line]
|