diff --git a/.gitignore b/.gitignore index 3afa476..b39fac2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ # typegen /typegen/target /build -/content/docs/types/QuickShell +/content/docs/types/QuickShell* /data/modules # hugo diff --git a/Justfile b/Justfile index 77362de..f89e6c4 100644 --- a/Justfile +++ b/Justfile @@ -2,12 +2,16 @@ clean: rm -rf build rm -rf data/modules/QuickShell rm -rf content/docs/types/QuickShell + rm -rf data/modules/QuickShell.Wayland + rm -rf content/docs/types/QuickShell.Wayland typedocs: clean cd typegen && cargo build mkdir -p build/types/types - ./typegen/target/debug/typegen gentypes ../src/cpp/module.md build/types/types/QuickShell.json - sh -c './typegen/target/debug/typegen gendocs ../src/cpp/module.md data/modules/QuickShell content/docs/types/QuickShell types/* build/types/types/*' + ./typegen/target/debug/typegen gentypes ../src/core/module.md build/types/types/QuickShell.json + ./typegen/target/debug/typegen gentypes ../src/wayland/module.md build/types/types/QuickShell.Wayland.json + sh -c './typegen/target/debug/typegen gendocs ../src/core/module.md data/modules/QuickShell content/docs/types/QuickShell types/* build/types/types/*' + sh -c './typegen/target/debug/typegen gendocs ../src/wayland/module.md data/modules/QuickShell.Wayland content/docs/types/QuickShell.Wayland types/* build/types/types/*' serve: typedocs hugo server --buildDrafts --disableFastRender diff --git a/typegen/src/parse.rs b/typegen/src/parse.rs index f27880b..05c5662 100644 --- a/typegen/src/parse.rs +++ b/typegen/src/parse.rs @@ -129,7 +129,7 @@ impl Default for ParseContext<'_> { impl Parser { pub fn new() -> Self { Self { - class_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*class\s+(?\w+)(?:\s*:\s*public\s+(?\w+))?.+?\{(?[\s\S]*?)};"#).unwrap(), + 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*(?(Q|QML)_\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(), fn_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*(?Q_INVOKABLE)?\s+(?(\w|::|<|>)+\*?)\s+(?\w+)\((?[\s\S]*?)\);"#).unwrap(),