From 1ca13d9ffded3fbddb0380c0d0df85304065efa9 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 3 Mar 2024 19:31:35 -0800 Subject: [PATCH] fix: make qmap parseable (but still not a type) --- typegen/src/parse.rs | 3 +-- typegen/src/resolver.rs | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/typegen/src/parse.rs b/typegen/src/parse.rs index aac0983..94182a6 100644 --- a/typegen/src/parse.rs +++ b/typegen/src/parse.rs @@ -132,7 +132,7 @@ impl Parser { Self { class_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*class\s+(?\w+)(?:\s*:\s*public\s+(?\w+)(\s*,(\s*\w+)*)*)?\s*\{(?[\s\S]*?)};"#).unwrap(), macro_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*(?QSDOC_HIDE\s)?(?(Q|QML|QSDOC)_\w+)\s*(\(\s*(?.*)\s*\))?;"#).unwrap(), - property_regex: Regex::new(r#"^\s*(?(\w|::|<|>)+\*?)\s+(?\w+)(\s+(MEMBER\s+(?\w+)|READ\s+(?\w+)|WRITE\s+(?\w+)|NOTIFY\s+(?\w+)|(?CONSTANT)))+\s*$"#).unwrap(), + property_regex: Regex::new(r#"^\s*(?(\w|::|, |<|>)+)\*?\s+(?\w+)(\s+(MEMBER\s+(?\w+)|READ\s+(?\w+)|WRITE\s+(?\w+)|NOTIFY\s+(?\w+)|(?CONSTANT)))+\s*$"#).unwrap(), fn_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*Q_INVOKABLE\s+(?(\w|::|<|>)+\*?)\s+(?\w+)\((?[\s\S]*?)\);"#).unwrap(), signal_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*void\s+(?\w+)\((?[\s\S]*?)\);"#).unwrap(), fn_param_regex: Regex::new(r#"(const\s+)?(?(\w|::|<|>)+\*?)&?\s+(?\w+)(,|$)"#).unwrap(), @@ -246,7 +246,6 @@ impl Parser { } for invokable in self.fn_regex.captures_iter(body) { - let comment = invokable.name("comment").map(|m| m.as_str()); let type_ = invokable.name("type").unwrap().as_str(); let name = invokable.name("name").unwrap().as_str(); diff --git a/typegen/src/resolver.rs b/typegen/src/resolver.rs index fab29d2..da6d294 100644 --- a/typegen/src/resolver.rs +++ b/typegen/src/resolver.rs @@ -122,10 +122,6 @@ pub fn resolve_types( list = true; } - if ctype.ends_with('*') { - ctype = &ctype[..ctype.len() - 1]; - } - let mut type_ = qmlparamtype(ctype, typespec); if list {