Merge master to fortuna #530

Merged
zxq9 merged 52 commits from merge_master_to_fortuna into fortuna 2019-03-05 22:51:14 +09:00
Showing only changes of commit c2a5ed28cf - Show all commits

View File

@ -92,11 +92,13 @@ from_string(ContractString, Options) ->
%% General programming errors in the compiler just signal error. %% General programming errors in the compiler just signal error.
end. end.
string_to_icode(ContractString, Options) -> -spec string_to_icode(string(), [option() | permissive_address_literals]) -> map().
string_to_icode(ContractString, Options0) ->
{InferOptions, Options} = lists:partition(fun(Opt) -> Opt == permissive_address_literals end, Options0),
Ast = parse(ContractString, Options), Ast = parse(ContractString, Options),
pp_sophia_code(Ast, Options), pp_sophia_code(Ast, Options),
pp_ast(Ast, Options), pp_ast(Ast, Options),
{TypeEnv, TypedAst} = aeso_ast_infer_types:infer(Ast, [return_env | Options]), {TypeEnv, TypedAst} = aeso_ast_infer_types:infer(Ast, [return_env | InferOptions]),
pp_typed_ast(TypedAst, Options), pp_typed_ast(TypedAst, Options),
Icode = ast_to_icode(TypedAst, Options), Icode = ast_to_icode(TypedAst, Options),
pp_icode(Icode, Options), pp_icode(Icode, Options),