From: duplo Date: Tue, 20 Jan 2009 16:23:07 +0000 (+0000) Subject: Make the regexp smarter X-Git-Tag: 2.1.0~494 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=34c21a456183dd6559e920c7d622e8a0277e60a7;p=bertos.git Make the regexp smarter git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2188 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index dfcaf68f..593bb462 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -96,11 +96,11 @@ def getInfos(definition): def getDefinitionBlocks(text): block = [] - block_tmp = re.findall(r"/\*{2}\s*([^*]*\*(?:[^/*][^*]*\*+)*)/\s*#define\s+([^/]*?/[^/]*?)\s*?(?!/{3}<.*?)$", text, re.MULTILINE) + block_tmp = re.findall(r"/\*{2}\s*([^*]*\*(?:[^/*][^*]*\*+)*)/\s*#define\s+((?:[^/]*?/?)+)\s*?(?:/{2,3}[^<].*?)?$", text, re.MULTILINE) for comment, define in block_tmp: - block.append((" ".join(re.findall(r"^\s*\*?\s*(.*?)\s*?$", comment, re.MULTILINE)), define)) - block += re.findall(r"/{3}