mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 01:07:48 +02:00
call info encoder
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user