diff --git a/dev/src/idl/parser.rs b/dev/src/idl/parser.rs index de9b9bd..f3cffa3 100644 --- a/dev/src/idl/parser.rs +++ b/dev/src/idl/parser.rs @@ -9,7 +9,7 @@ enum Declaration{ EnumDeclaration(EnumDeclaration), StructDeclaration(StructDeclaration), TypeDeclaration(TypeDeclaration), - ProtocolDeclaration, + ProtocolDeclaration(ProtocolDeclaration), } #[derive(Debug, Clone, PartialEq)] struct StructDeclaration { @@ -38,6 +38,19 @@ struct EnumMember { number: u64, } +#[derive(Debug, Clone, PartialEq)] +struct ProtocolDeclaration{ + name : String, + interface : Vec, +} + +#[derive(Debug, Clone, PartialEq)] +struct FuncDeclaration { + name : String, + input_types : Vec, + return_type : String, +} + /// Consume's a token that's expected. If the token that's consumed is not /// the given expected token then panic @@ -200,3 +213,4 @@ fn parse_number(tokens : &mut Peekable>) -> Option { } result } +