From b5cdc9c4fd397958dd70ce943628f4e6c27f6f4a Mon Sep 17 00:00:00 2001 From: Talha Qamar Date: Wed, 11 Sep 2024 01:29:18 +0500 Subject: [PATCH] changed file extension to .aldi and made it so that decorators don't work --- dev/src/idl/mod.rs | 2 +- dev/src/idl/parser.rs | 1 + dev/src/main.rs | 2 +- sysdata/idl/log/src/{protocol.aidl => protocol.aldi} | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) rename sysdata/idl/log/src/{protocol.aidl => protocol.aldi} (97%) diff --git a/dev/src/idl/mod.rs b/dev/src/idl/mod.rs index b636cbbf..4b14ee30 100644 --- a/dev/src/idl/mod.rs +++ b/dev/src/idl/mod.rs @@ -85,7 +85,7 @@ fn build(a: Vec) { } fn open_protocol(name: String) -> String { - let path = format!("sysdata/idl/{}/src/protocol.aidl", name); + let path = format!("sysdata/idl/{}/src/protocol.aldi", name); let mut file = std::fs::File::open(path).unwrap(); let mut contents = String::new(); file.read_to_string(&mut contents).unwrap(); diff --git a/dev/src/idl/parser.rs b/dev/src/idl/parser.rs index f0606211..ccf5392d 100644 --- a/dev/src/idl/parser.rs +++ b/dev/src/idl/parser.rs @@ -32,6 +32,7 @@ fn parse_decorated_declarations(tokens : &mut Peekable>) -> Vec< match tokens.peek() { Some(_) => { let decoration = parse_decoration(tokens); + assert!(decoration == None, "NO DECORATIONS!!!"); let declaration = parse_declaration(tokens); declarations.push(DecoratedDeclaration(decoration, declaration)); diff --git a/dev/src/main.rs b/dev/src/main.rs index 42406436..2ba2c3e2 100644 --- a/dev/src/main.rs +++ b/dev/src/main.rs @@ -57,7 +57,7 @@ pub fn new(development_type: DevelopmentType, name: String) { let (folder_hierarchy, entry_name) = match development_type { DevelopmentType::Program => ("programs", "main.hb"), DevelopmentType::Library => ("libraries", "lib.hb"), - DevelopmentType::IDL => ("idl", "protocol.aidl"), + DevelopmentType::IDL => ("idl", "protocol.aldi"), }; let project_folder_path_string = format!("sysdata/{folder_hierarchy}/{name}"); diff --git a/sysdata/idl/log/src/protocol.aidl b/sysdata/idl/log/src/protocol.aldi similarity index 97% rename from sysdata/idl/log/src/protocol.aidl rename to sysdata/idl/log/src/protocol.aldi index cc46a32b..f8ff23a6 100644 --- a/sysdata/idl/log/src/protocol.aidl +++ b/sysdata/idl/log/src/protocol.aldi @@ -13,7 +13,7 @@ // Err = 0, // Ok, //} -@example + struct Log { log_level: LogLevel, }