Restructure and start working on CLI

This commit is contained in:
Fabian Stamm
2025-05-26 16:43:40 +02:00
parent 883b6da7eb
commit b61518de00
38 changed files with 134 additions and 8 deletions

28
libjrpc/src/shared.rs Normal file
View 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(),
}
}
}