forked from AbleOS/ableos
Added ProtocolDeclaration datatype
This commit is contained in:
parent
f9451e3d7d
commit
45950fdb34
|
@ -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<FuncDeclaration>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
struct FuncDeclaration {
|
||||
name : String,
|
||||
input_types : Vec<String>,
|
||||
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<Iter<'_, Token>>) -> Option<u64> {
|
|||
}
|
||||
result
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue