Move TYPEREP defs to aebytecode
This commit is contained in:
parent
333bf53537
commit
7e7f061b34
11
include/aeb_typerep_def.hrl
Normal file
11
include/aeb_typerep_def.hrl
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
-define(Type(), aeb_aevm_data:type()).
|
||||
|
||||
-define(TYPEREP_WORD_TAG, 0).
|
||||
-define(TYPEREP_STRING_TAG, 1).
|
||||
-define(TYPEREP_LIST_TAG, 2).
|
||||
-define(TYPEREP_TUPLE_TAG, 3).
|
||||
-define(TYPEREP_VARIANT_TAG, 4).
|
||||
-define(TYPEREP_TYPEREP_TAG, 5).
|
||||
-define(TYPEREP_MAP_TAG, 6).
|
||||
-define(TYPEREP_FUN_TAG, 7).
|
@ -21,7 +21,7 @@
|
||||
|
||||
-export_type([binary_value/0, heap_value/0, offset/0, heap_fragment/0]).
|
||||
|
||||
-include("aeb_icode.hrl").
|
||||
-include_lib("aebytecode/include/aeb_typerep_def.hrl").
|
||||
-include_lib("aebytecode/include/aeb_heap.hrl").
|
||||
|
||||
-type word() :: non_neg_integer().
|
||||
|
@ -1,68 +0,0 @@
|
||||
|
||||
-define(Type(), aeb_aevm_data:type()).
|
||||
|
||||
-define(TYPEREP_WORD_TAG, 0).
|
||||
-define(TYPEREP_STRING_TAG, 1).
|
||||
-define(TYPEREP_LIST_TAG, 2).
|
||||
-define(TYPEREP_TUPLE_TAG, 3).
|
||||
-define(TYPEREP_VARIANT_TAG, 4).
|
||||
-define(TYPEREP_TYPEREP_TAG, 5).
|
||||
-define(TYPEREP_MAP_TAG, 6).
|
||||
-define(TYPEREP_FUN_TAG, 7).
|
||||
|
||||
-record(arg, {name::string(), type::?Type()}).
|
||||
|
||||
-type expr() :: term().
|
||||
-type arg() :: #arg{name::string(), type::?Type()}.
|
||||
-type arg_list() :: [arg()].
|
||||
|
||||
-record(fun_dec, { name :: string()
|
||||
, args :: arg_list()
|
||||
, body :: expr()}).
|
||||
|
||||
-record(var_ref, { name :: string() | list(string()) | {builtin, atom() | tuple()}}).
|
||||
|
||||
-record(prim_call_contract,
|
||||
{ gas :: expr()
|
||||
, address :: expr()
|
||||
, value :: expr()
|
||||
, arg :: expr()
|
||||
, type_hash:: expr()
|
||||
}).
|
||||
|
||||
-record(prim_balance, { address :: expr() }).
|
||||
-record(prim_block_hash, { height :: expr() }).
|
||||
-record(prim_put, { state :: expr() }).
|
||||
|
||||
-record(integer, {value :: integer()}).
|
||||
|
||||
-record(tuple, {cpts :: [expr()]}).
|
||||
|
||||
-record(list, {elems :: [expr()]}).
|
||||
|
||||
-record(unop, { op :: term()
|
||||
, rand :: expr()}).
|
||||
|
||||
-record(binop, { op :: term()
|
||||
, left :: expr()
|
||||
, right :: expr()}).
|
||||
|
||||
-record(ifte, { decision :: expr()
|
||||
, then :: expr()
|
||||
, else :: expr()}).
|
||||
|
||||
-record(switch, { expr :: expr()
|
||||
, cases :: [{expr(),expr()}]}).
|
||||
|
||||
-record(funcall, { function :: expr()
|
||||
, args :: [expr()]}).
|
||||
|
||||
-record(lambda, { args :: arg_list(),
|
||||
body :: expr()}).
|
||||
|
||||
-record(missing_field, { format :: string()
|
||||
, args :: [term()]}).
|
||||
|
||||
-record(seq, {exprs :: [expr()]}).
|
||||
|
||||
-record(event, {topics :: [expr()], payload :: expr()}).
|
Loading…
x
Reference in New Issue
Block a user