From ade833bb947560a84ddf007012b3c185c7c8056b Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 22 Jun 2024 01:59:08 -0700 Subject: [PATCH] typegen: support generics on superclass + nix lockfile update --- flake.lock | 8 ++++---- typegen/src/parse.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index d0792d4..f7a22e0 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1718923189, - "narHash": "sha256-hC0o/1SxTxDdHlI+aUpHdglvIU9ka+M/nTaGbWqu92M=", + "lastModified": 1719046668, + "narHash": "sha256-G1Ws0z+oXoPe9K9cUuFek2hsXXnWR6hE3++K1tz5DyI=", "ref": "refs/heads/master", - "rev": "3573663ab648ff793e6ad545b63eaa5979633e51", - "revCount": 227, + "rev": "09d8a7a07d9d431e1e2e41f574a1079f0341ffe5", + "revCount": 231, "type": "git", "url": "https://git.outfoxxed.me/outfoxxed/quickshell" }, diff --git a/typegen/src/parse.rs b/typegen/src/parse.rs index 33637ea..b2b4f01 100644 --- a/typegen/src/parse.rs +++ b/typegen/src/parse.rs @@ -132,7 +132,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*\w+)*)*)?\s*\{(?[\s\S]*?)(?!};\s*Q_ENUM)};"#).unwrap(), + class_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*class\s+(?\w+)(?:\s*:\s*public\s+((?\w+)(<.+>)?)(\s*,(\s*\w+)*)*)?\s*\{(?[\s\S]*?)(?!};\s*Q_ENUM)};"#).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(), fn_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*Q_INVOKABLE\s+(\[\[.*\]\]\s+)?(static\s+)?(?(\w|::|<|>)+\*?)\s+(?\w+)\((?[\s\S]*?)\)(\s*const)?;"#).unwrap(),