#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ParsedExpr {
#[prost(message, optional, tag = "2")]
pub expr: ::core::option::Option<Expr>,
#[prost(message, optional, tag = "3")]
pub source_info: ::core::option::Option<SourceInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Expr {
#[prost(int64, tag = "2")]
pub id: i64,
#[prost(oneof = "expr::ExprKind", tags = "3, 4, 5, 6, 7, 8, 9")]
pub expr_kind: ::core::option::Option<expr::ExprKind>,
}
pub mod expr {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ident {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Select {
#[prost(message, optional, boxed, tag = "1")]
pub operand: ::core::option::Option<::prost::alloc::boxed::Box<super::Expr>>,
#[prost(string, tag = "2")]
pub field: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub test_only: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Call {
#[prost(message, optional, boxed, tag = "1")]
pub target: ::core::option::Option<::prost::alloc::boxed::Box<super::Expr>>,
#[prost(string, tag = "2")]
pub function: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub args: ::prost::alloc::vec::Vec<super::Expr>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateList {
#[prost(message, repeated, tag = "1")]
pub elements: ::prost::alloc::vec::Vec<super::Expr>,
#[prost(int32, repeated, tag = "2")]
pub optional_indices: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateStruct {
#[prost(string, tag = "1")]
pub message_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<create_struct::Entry>,
}
pub mod create_struct {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entry {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(message, optional, tag = "4")]
pub value: ::core::option::Option<super::super::Expr>,
#[prost(bool, tag = "5")]
pub optional_entry: bool,
#[prost(oneof = "entry::KeyKind", tags = "2, 3")]
pub key_kind: ::core::option::Option<entry::KeyKind>,
}
pub mod entry {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum KeyKind {
#[prost(string, tag = "2")]
FieldKey(::prost::alloc::string::String),
#[prost(message, tag = "3")]
MapKey(super::super::super::Expr),
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Comprehension {
#[prost(string, tag = "1")]
pub iter_var: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub iter_var2: ::prost::alloc::string::String,
#[prost(message, optional, boxed, tag = "2")]
pub iter_range: ::core::option::Option<::prost::alloc::boxed::Box<super::Expr>>,
#[prost(string, tag = "3")]
pub accu_var: ::prost::alloc::string::String,
#[prost(message, optional, boxed, tag = "4")]
pub accu_init: ::core::option::Option<::prost::alloc::boxed::Box<super::Expr>>,
#[prost(message, optional, boxed, tag = "5")]
pub loop_condition: ::core::option::Option<
::prost::alloc::boxed::Box<super::Expr>,
>,
#[prost(message, optional, boxed, tag = "6")]
pub loop_step: ::core::option::Option<::prost::alloc::boxed::Box<super::Expr>>,
#[prost(message, optional, boxed, tag = "7")]
pub result: ::core::option::Option<::prost::alloc::boxed::Box<super::Expr>>,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ExprKind {
#[prost(message, tag = "3")]
ConstExpr(super::Constant),
#[prost(message, tag = "4")]
IdentExpr(Ident),
#[prost(message, tag = "5")]
SelectExpr(::prost::alloc::boxed::Box<Select>),
#[prost(message, tag = "6")]
CallExpr(::prost::alloc::boxed::Box<Call>),
#[prost(message, tag = "7")]
ListExpr(CreateList),
#[prost(message, tag = "8")]
StructExpr(CreateStruct),
#[prost(message, tag = "9")]
ComprehensionExpr(::prost::alloc::boxed::Box<Comprehension>),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Constant {
#[prost(oneof = "constant::ConstantKind", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
pub constant_kind: ::core::option::Option<constant::ConstantKind>,
}
pub mod constant {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ConstantKind {
#[prost(
enumeration = "super::super::super::super::protobuf::NullValue",
tag = "1"
)]
NullValue(i32),
#[prost(bool, tag = "2")]
BoolValue(bool),
#[prost(int64, tag = "3")]
Int64Value(i64),
#[prost(uint64, tag = "4")]
Uint64Value(u64),
#[prost(double, tag = "5")]
DoubleValue(f64),
#[prost(string, tag = "6")]
StringValue(::prost::alloc::string::String),
#[prost(bytes, tag = "7")]
BytesValue(::prost::alloc::vec::Vec<u8>),
#[prost(message, tag = "8")]
DurationValue(super::super::super::super::protobuf::Duration),
#[prost(message, tag = "9")]
TimestampValue(super::super::super::super::protobuf::Timestamp),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceInfo {
#[prost(string, tag = "1")]
pub syntax_version: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub location: ::prost::alloc::string::String,
#[prost(int32, repeated, tag = "3")]
pub line_offsets: ::prost::alloc::vec::Vec<i32>,
#[prost(map = "int64, int32", tag = "4")]
pub positions: ::std::collections::HashMap<i64, i32>,
#[prost(map = "int64, message", tag = "5")]
pub macro_calls: ::std::collections::HashMap<i64, Expr>,
#[prost(message, repeated, tag = "6")]
pub extensions: ::prost::alloc::vec::Vec<source_info::Extension>,
}
pub mod source_info {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Extension {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(enumeration = "extension::Component", repeated, tag = "2")]
pub affected_components: ::prost::alloc::vec::Vec<i32>,
#[prost(message, optional, tag = "3")]
pub version: ::core::option::Option<extension::Version>,
}
pub mod extension {
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Version {
#[prost(int64, tag = "1")]
pub major: i64,
#[prost(int64, tag = "2")]
pub minor: i64,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Component {
Unspecified = 0,
Parser = 1,
TypeChecker = 2,
Runtime = 3,
}
impl Component {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "COMPONENT_UNSPECIFIED",
Self::Parser => "COMPONENT_PARSER",
Self::TypeChecker => "COMPONENT_TYPE_CHECKER",
Self::Runtime => "COMPONENT_RUNTIME",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMPONENT_UNSPECIFIED" => Some(Self::Unspecified),
"COMPONENT_PARSER" => Some(Self::Parser),
"COMPONENT_TYPE_CHECKER" => Some(Self::TypeChecker),
"COMPONENT_RUNTIME" => Some(Self::Runtime),
_ => None,
}
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourcePosition {
#[prost(string, tag = "1")]
pub location: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub offset: i32,
#[prost(int32, tag = "3")]
pub line: i32,
#[prost(int32, tag = "4")]
pub column: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckedExpr {
#[prost(map = "int64, message", tag = "2")]
pub reference_map: ::std::collections::HashMap<i64, Reference>,
#[prost(map = "int64, message", tag = "3")]
pub type_map: ::std::collections::HashMap<i64, Type>,
#[prost(message, optional, tag = "5")]
pub source_info: ::core::option::Option<SourceInfo>,
#[prost(string, tag = "6")]
pub expr_version: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub expr: ::core::option::Option<Expr>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Type {
#[prost(
oneof = "r#type::TypeKind",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14"
)]
pub type_kind: ::core::option::Option<r#type::TypeKind>,
}
pub mod r#type {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListType {
#[prost(message, optional, boxed, tag = "1")]
pub elem_type: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MapType {
#[prost(message, optional, boxed, tag = "1")]
pub key_type: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
#[prost(message, optional, boxed, tag = "2")]
pub value_type: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FunctionType {
#[prost(message, optional, boxed, tag = "1")]
pub result_type: ::core::option::Option<::prost::alloc::boxed::Box<super::Type>>,
#[prost(message, repeated, tag = "2")]
pub arg_types: ::prost::alloc::vec::Vec<super::Type>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbstractType {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub parameter_types: ::prost::alloc::vec::Vec<super::Type>,
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum PrimitiveType {
Unspecified = 0,
Bool = 1,
Int64 = 2,
Uint64 = 3,
Double = 4,
String = 5,
Bytes = 6,
}
impl PrimitiveType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PRIMITIVE_TYPE_UNSPECIFIED",
Self::Bool => "BOOL",
Self::Int64 => "INT64",
Self::Uint64 => "UINT64",
Self::Double => "DOUBLE",
Self::String => "STRING",
Self::Bytes => "BYTES",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PRIMITIVE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"BOOL" => Some(Self::Bool),
"INT64" => Some(Self::Int64),
"UINT64" => Some(Self::Uint64),
"DOUBLE" => Some(Self::Double),
"STRING" => Some(Self::String),
"BYTES" => Some(Self::Bytes),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum WellKnownType {
Unspecified = 0,
Any = 1,
Timestamp = 2,
Duration = 3,
}
impl WellKnownType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "WELL_KNOWN_TYPE_UNSPECIFIED",
Self::Any => "ANY",
Self::Timestamp => "TIMESTAMP",
Self::Duration => "DURATION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"WELL_KNOWN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ANY" => Some(Self::Any),
"TIMESTAMP" => Some(Self::Timestamp),
"DURATION" => Some(Self::Duration),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TypeKind {
#[prost(message, tag = "1")]
Dyn(super::super::super::super::protobuf::Empty),
#[prost(
enumeration = "super::super::super::super::protobuf::NullValue",
tag = "2"
)]
Null(i32),
#[prost(enumeration = "PrimitiveType", tag = "3")]
Primitive(i32),
#[prost(enumeration = "PrimitiveType", tag = "4")]
Wrapper(i32),
#[prost(enumeration = "WellKnownType", tag = "5")]
WellKnown(i32),
#[prost(message, tag = "6")]
ListType(::prost::alloc::boxed::Box<ListType>),
#[prost(message, tag = "7")]
MapType(::prost::alloc::boxed::Box<MapType>),
#[prost(message, tag = "8")]
Function(::prost::alloc::boxed::Box<FunctionType>),
#[prost(string, tag = "9")]
MessageType(::prost::alloc::string::String),
#[prost(string, tag = "10")]
TypeParam(::prost::alloc::string::String),
#[prost(message, tag = "11")]
Type(::prost::alloc::boxed::Box<super::Type>),
#[prost(message, tag = "12")]
Error(super::super::super::super::protobuf::Empty),
#[prost(message, tag = "14")]
AbstractType(AbstractType),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Decl {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(oneof = "decl::DeclKind", tags = "2, 3")]
pub decl_kind: ::core::option::Option<decl::DeclKind>,
}
pub mod decl {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IdentDecl {
#[prost(message, optional, tag = "1")]
pub r#type: ::core::option::Option<super::Type>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<super::Constant>,
#[prost(string, tag = "3")]
pub doc: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FunctionDecl {
#[prost(message, repeated, tag = "1")]
pub overloads: ::prost::alloc::vec::Vec<function_decl::Overload>,
}
pub mod function_decl {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Overload {
#[prost(string, tag = "1")]
pub overload_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub params: ::prost::alloc::vec::Vec<super::super::Type>,
#[prost(string, repeated, tag = "3")]
pub type_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub result_type: ::core::option::Option<super::super::Type>,
#[prost(bool, tag = "5")]
pub is_instance_function: bool,
#[prost(string, tag = "6")]
pub doc: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum DeclKind {
#[prost(message, tag = "2")]
Ident(IdentDecl),
#[prost(message, tag = "3")]
Function(FunctionDecl),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Reference {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub overload_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub value: ::core::option::Option<Constant>,
}