Change function references from aeso_sophia to aeb_aevm_data
This commit is contained in:
parent
fd0dbdf207
commit
9f5f8d4444
@ -674,7 +674,7 @@ make_type_def(Args, Def, Icode = #{ type_vars := TypeEnv }) ->
|
|||||||
ast_typerep(Def, Icode#{ type_vars := maps:merge(TypeEnv, TypeEnv1) })
|
ast_typerep(Def, Icode#{ type_vars := maps:merge(TypeEnv, TypeEnv1) })
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec ast_typerep(aeso_syntax:type()) -> aeso_sophia:type().
|
-spec ast_typerep(aeso_syntax:type()) -> aeb_aevm_data:type().
|
||||||
ast_typerep(Type) -> ast_typerep(Type, aeso_icode:new([])).
|
ast_typerep(Type) -> ast_typerep(Type, aeso_icode:new([])).
|
||||||
|
|
||||||
ast_typerep({id, _, Name}, Icode) ->
|
ast_typerep({id, _, Name}, Icode) ->
|
||||||
|
@ -208,7 +208,7 @@ last_contract_indent(Decls) ->
|
|||||||
_ -> 0
|
_ -> 0
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec to_sophia_value(string(), string(), ok | error | revert, aeso_sophia:data()) ->
|
-spec to_sophia_value(string(), string(), ok | error | revert, aeb_aevm_data:data()) ->
|
||||||
{ok, aeso_syntax:expr()} | {error, term()}.
|
{ok, aeso_syntax:expr()} | {error, term()}.
|
||||||
to_sophia_value(ContractString, Fun, ResType, Data) ->
|
to_sophia_value(ContractString, Fun, ResType, Data) ->
|
||||||
to_sophia_value(ContractString, Fun, ResType, Data, []).
|
to_sophia_value(ContractString, Fun, ResType, Data, []).
|
||||||
@ -260,7 +260,7 @@ to_sophia_value(ContractString, FunName, ok, Data, Options) ->
|
|||||||
address_literal(N) -> {hash, [], <<N:256>>}. % TODO
|
address_literal(N) -> {hash, [], <<N:256>>}. % TODO
|
||||||
|
|
||||||
%% TODO: somewhere else
|
%% TODO: somewhere else
|
||||||
-spec translate_vm_value(aeso_sophia:type(), aeso_syntax:type(), aeso_sophia:data()) -> aeso_syntax:expr().
|
-spec translate_vm_value(aeb_aevm_data:type(), aeso_syntax:type(), aeb_aevm_data:data()) -> aeso_syntax:expr().
|
||||||
translate_vm_value(word, {id, _, "address"}, N) -> address_literal(N);
|
translate_vm_value(word, {id, _, "address"}, N) -> address_literal(N);
|
||||||
translate_vm_value(word, {app_t, _, {id, _, "oracle"}, _}, N) -> address_literal(N);
|
translate_vm_value(word, {app_t, _, {id, _, "oracle"}, _}, N) -> address_literal(N);
|
||||||
translate_vm_value(word, {app_t, _, {id, _, "oracle_query"}, _}, N) -> address_literal(N);
|
translate_vm_value(word, {app_t, _, {id, _, "oracle_query"}, _}, N) -> address_literal(N);
|
||||||
@ -313,7 +313,7 @@ translate_vm_value(_VmType, _Type, _Data) ->
|
|||||||
throw(cannot_translate_to_sophia).
|
throw(cannot_translate_to_sophia).
|
||||||
|
|
||||||
-spec create_calldata(string(), string(), [string()]) ->
|
-spec create_calldata(string(), string(), [string()]) ->
|
||||||
{ok, binary(), aeso_sophia:type(), aeso_sophia:type()}
|
{ok, binary(), aeb_aevm_data:type(), aeb_aevm_data:type()}
|
||||||
| {error, term()}.
|
| {error, term()}.
|
||||||
create_calldata(Code, Fun, Args) ->
|
create_calldata(Code, Fun, Args) ->
|
||||||
case check_call(Code, Fun, Args, []) of
|
case check_call(Code, Fun, Args, []) of
|
||||||
|
@ -25,14 +25,14 @@
|
|||||||
|
|
||||||
-include("aeso_icode.hrl").
|
-include("aeso_icode.hrl").
|
||||||
|
|
||||||
-type type_def() :: fun(([aeso_sophia:type()]) -> aeso_sophia:type()).
|
-type type_def() :: fun(([aeb_aevm_data:type()]) -> aeb_aevm_data:type()).
|
||||||
|
|
||||||
-type bindings() :: any().
|
-type bindings() :: any().
|
||||||
-type fun_dec() :: { string()
|
-type fun_dec() :: { string()
|
||||||
, [modifier()]
|
, [modifier()]
|
||||||
, arg_list()
|
, arg_list()
|
||||||
, expr()
|
, expr()
|
||||||
, aeso_sophia:type()}.
|
, aeb_aevm_data:type()}.
|
||||||
|
|
||||||
-type modifier() :: private | stateful.
|
-type modifier() :: private | stateful.
|
||||||
|
|
||||||
@ -42,10 +42,10 @@
|
|||||||
, functions => [fun_dec()]
|
, functions => [fun_dec()]
|
||||||
, namespace => aeso_syntax:con() | aeso_syntax:qcon()
|
, namespace => aeso_syntax:con() | aeso_syntax:qcon()
|
||||||
, env => [bindings()]
|
, env => [bindings()]
|
||||||
, state_type => aeso_sophia:type()
|
, state_type => aeb_aevm_data:type()
|
||||||
, event_type => aeso_sophia:type()
|
, event_type => aeb_aevm_data:type()
|
||||||
, types => #{ type_name() => type_def() }
|
, types => #{ type_name() => type_def() }
|
||||||
, type_vars => #{ string() => aeso_sophia:type() }
|
, type_vars => #{ string() => aeb_aevm_data:type() }
|
||||||
, constructors => #{ [string()] => integer() } %% name to tag
|
, constructors => #{ [string()] => integer() } %% name to tag
|
||||||
, options => [any()]
|
, options => [any()]
|
||||||
}.
|
}.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
-define(Type(), aeso_sophia:type()).
|
-define(Type(), aeb_aevm_data:type()).
|
||||||
|
|
||||||
-define(TYPEREP_WORD_TAG, 0).
|
-define(TYPEREP_WORD_TAG, 0).
|
||||||
-define(TYPEREP_STRING_TAG, 1).
|
-define(TYPEREP_STRING_TAG, 1).
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
-module(aeso_sophia).
|
|
||||||
|
|
||||||
-export_type([data/0,
|
|
||||||
type/0,
|
|
||||||
heap/0]).
|
|
||||||
|
|
||||||
-type type() :: word | signed_word | string | typerep | function
|
|
||||||
| {list, type()}
|
|
||||||
| {option, type()}
|
|
||||||
| {tuple, [type()]}
|
|
||||||
| {variant, [[type()]]}.
|
|
||||||
|
|
||||||
|
|
||||||
-type data() :: none
|
|
||||||
| {some, data()}
|
|
||||||
| {option, data()}
|
|
||||||
| word
|
|
||||||
| string
|
|
||||||
| {list, data()}
|
|
||||||
| {tuple, [data()]}
|
|
||||||
| {variant, integer(), [data()]}
|
|
||||||
| integer()
|
|
||||||
| binary()
|
|
||||||
| [data()]
|
|
||||||
| {}
|
|
||||||
| {data()}
|
|
||||||
| {data(), data()}.
|
|
||||||
|
|
||||||
-type heap() :: binary().
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user