Match the ///< comments only with the third regexp
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 20 Jan 2009 13:40:05 +0000 (13:40 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 20 Jan 2009 13:40:05 +0000 (13:40 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2187 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index a50df0f49e0eb5ac49288d6e2dbfcf2fc3dc06f6..dfcaf68f73777f268f0887199f1d87d64c5354b7 100644 (file)
@@ -96,10 +96,10 @@ def getInfos(definition):
 
 def getDefinitionBlocks(text):
     block = []
-    block_tmp = re.findall(r"/\*{2}\s*([^*]*\*(?:[^/*][^*]*\*+)*)/\s*#define\s+(.*?)\s*?$", text, re.MULTILINE)
+    block_tmp = re.findall(r"/\*{2}\s*([^*]*\*(?:[^/*][^*]*\*+)*)/\s*#define\s+([^/]*?/[^/]*?)\s*?(?!/{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}<?\s*(.*)\s*#define\s+(.*)\s*?$", text, re.MULTILINE)
+    block += re.findall(r"/{3}<?\s*(.*)\s*#define\s+([^/]*?/[^/]*?)\s*?$", text, re.MULTILINE)
     block += [(comment, define) for define, comment in re.findall(r"#define\s*(.*?)\s*/{3}<\s*(.*?)\s*?$", text, re.MULTILINE)]
     return block