let rec compile_function_definition name arg_list expr_list =
let label = make_label name in
let args = note_arg_list arg_list 0 in
let body_code = compile_expression_list expr_list in
[NoteFunction name;
Instruction (Annotation (concat ["function ";name;" ";string_of_int (List.length arg_list)])); | (** annotate *) |
Instruction (Label label);
BeginScope]
@ args
@ body_code
@ [Instruction (Comment (concat ["end function ";name]));
Instruction ConstUninit;
Instruction Return;
EndScope]