Commit f2ae3b72 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur 🏢
Browse files

introduced newFunctionWithType

parent e7799fbd
......@@ -655,20 +655,28 @@ where
newFunction :: !(Optional Ident) !FunctionBody ![FreeVar] ![AType] !AType !Int !(!Int, ![FunctionInfoPtr],!*FunctionHeap)
-> (! SymbIdent, !(!Int, ![FunctionInfoPtr],!*FunctionHeap))
newFunction opt_id fun_bodies local_vars arg_types result_type group_index (cs_next_fun_nr, cs_new_functions, cs_fun_heap)
# (fun_def_ptr, cs_fun_heap) = newPtr FI_Empty cs_fun_heap
fun_id = getIdent opt_id cs_next_fun_nr
arity = length arg_types
newFunction opt_id fun_bodies local_vars arg_types result_type group_index state
= newFunctionWithType opt_id fun_bodies local_vars fun_type group_index state
where
fun_type =
{ st_vars = []
{ st_vars = []
, st_args = arg_types
, st_arity = arity
, st_arity = length arg_types // -*-> ("newFunction", fun_id.id_name)
, st_result = result_type
, st_context = []
, st_attr_vars = []
, st_attr_env = []
}
newFunctionWithType :: !(Optional Ident) !FunctionBody ![FreeVar] !SymbolType !Int !(!Int, ![FunctionInfoPtr],!*FunctionHeap)
-> (! SymbIdent, !(!Int, ![FunctionInfoPtr],!*FunctionHeap))
newFunctionWithType opt_id fun_bodies local_vars fun_type group_index (cs_next_fun_nr, cs_new_functions, cs_fun_heap)
# (fun_def_ptr, cs_fun_heap) = newPtr FI_Empty cs_fun_heap
fun_id = getIdent opt_id cs_next_fun_nr
arity
= fun_type.st_arity
fun_def =
{ fun_symb = fun_id
, fun_arity = arity
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment