Restructure and start working on CLI
This commit is contained in:
28
libjrpc/src/shared.rs
Normal file
28
libjrpc/src/shared.rs
Normal file
@ -0,0 +1,28 @@
|
||||
pub enum Keywords {
|
||||
Type,
|
||||
Enum,
|
||||
Import,
|
||||
Service,
|
||||
Define,
|
||||
}
|
||||
|
||||
impl Keywords {
|
||||
pub fn is_keyword(input: &str) -> bool {
|
||||
match input {
|
||||
"type" | "enum" | "import" | "service" | "define" => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToString for Keywords {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
Keywords::Type => "type".to_string(),
|
||||
Keywords::Enum => "enum".to_string(),
|
||||
Keywords::Import => "import".to_string(),
|
||||
Keywords::Service => "service".to_string(),
|
||||
Keywords::Define => "define".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user