blob: 9ad66ffaa90497bc2c81d53b54e2e9a95600a0dc (
plain) (
tree)
|
|
definition module Snug.Compile
from Data.Error import :: MaybeError
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] -> MaybeError String [Line]
|