call info encoder

This commit is contained in:
Fernando Herrera
2021-10-26 20:50:39 +01:00
parent 36a834c1e3
commit af02c8f6ea
8 changed files with 700 additions and 207 deletions

View File

@ -1,13 +1,29 @@
@0xb299d30dc02d72bc;
# Generic structs used as helpers for the encoding
struct Option(Value) {
union {
none @0 :Void;
some @1 :Value;
}
}
struct Map(Key, Value) {
struct Entry {
key @0 :Key;
value @1 :Value;
}
entries @0 :List(Entry);
}
struct Span {
start @0 :UInt64;
end @1 :UInt64;
}
struct Value {
span @0: Span;
struct Span {
start @0 :UInt64;
end @1 :UInt64;
}
union {
void @1 :Void;
bool @2 :Bool;
@ -17,3 +33,25 @@ struct Value {
list @6 :List(Value);
}
}
struct Expression {
union {
garbage @0 :Void;
bool @1 :Bool;
int @2 :Int64;
float @3 :Float64;
string @4 :Text;
list @5 :List(Expression);
}
}
struct Call {
head @0: Span;
positional @1 :List(Expression);
named @2 :Map(Text, Option(Expression));
}
struct CallInfo {
call @0: Call;
input @1: Value;
}