mirror of
https://github.com/zap-proto/erlang.git
synced 2026-10-30 15:05:14 +00:00
fix regression in ecapnp_compiler after the change to how union values of type void are returned.
82 lines
1.9 KiB
Erlang
82 lines
1.9 KiB
Erlang
%% ecapnp schema records
|
|
%%
|
|
%% Bump version number on ANY change in ANY of the records in this file.
|
|
%% Must have the same version in both ecapnp runtime libs and compiled schemas.
|
|
-ecapnp_schema_version(4).
|
|
|
|
%% Common record for all schema nodes
|
|
-record(schema_node, {
|
|
module :: atom(),
|
|
name :: ecapnp:type_name(),
|
|
id = 0 :: ecapnp:type_id(),
|
|
src = <<>> :: ecapnp:text(),
|
|
kind = file :: ecapnp:schema_kind(),
|
|
annotations = [] :: list(),
|
|
nodes = [] :: ecapnp:schema_nodes(),
|
|
scope = 0 :: ecapnp:type_id()
|
|
}).
|
|
|
|
%% Struct node
|
|
-record(struct, {
|
|
dsize = 0 :: ecapnp:word_count(),
|
|
psize = 0 :: ecapnp:ptr_count(),
|
|
esize = inlineComposite :: ecapnp:element_size(),
|
|
union_field = none :: none | ecapnp:field_type(),
|
|
fields = [] :: ecapnp:struct_fields()
|
|
}).
|
|
|
|
%% Enum node
|
|
-record(enum, {
|
|
values = [] :: ecapnp:enum_values()
|
|
}).
|
|
|
|
%% Interface node
|
|
-record(interface, {
|
|
extends = [] :: list(),
|
|
methods = [] :: list()
|
|
}).
|
|
|
|
%% Const node
|
|
-record(const, {
|
|
field
|
|
}).
|
|
|
|
%% Annotation node
|
|
-record(annotation, {
|
|
type,
|
|
targets = [] :: list(atom())
|
|
}).
|
|
|
|
%% Struct field
|
|
-record(field, {
|
|
id,
|
|
name,
|
|
kind,
|
|
annotations = []
|
|
}).
|
|
|
|
%% Schema Field types
|
|
-record(ptr, {
|
|
type :: term(),
|
|
idx = 0 :: ecapnp:ptr_index(),
|
|
default = <<0:64/integer-little>> :: ecapnp:value()
|
|
}).
|
|
|
|
-record(data, {
|
|
type :: term(),
|
|
align = 0 :: ecapnp:bit_count(),
|
|
default :: ecapnp:value()
|
|
}).
|
|
|
|
-record(group, {
|
|
id = 0 :: ecapnp:type_id()
|
|
}).
|
|
|
|
%% Interface methods
|
|
-record(method, {
|
|
id,
|
|
name,
|
|
paramType,
|
|
resultType
|
|
}).
|