Modify the regexp for the configuration parameter comments
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 19 Jan 2009 13:35:20 +0000 (13:35 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 19 Jan 2009 13:35:20 +0000 (13:35 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2180 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index fc225d0a4ebf5e7e331a024c2a1bb1fdd9d17210..428e11e6a3ad125f69c8ee71eb6364c482ef4554 100644 (file)
@@ -96,8 +96,8 @@ def getInfos(definition):
 
 def getDefinitionBlocks(text):
     block = []
-    block_tmp = re.findall("^/\*+\s*(.*?)\s*?\*/\s*#define\s+(\w+[\s\w]*?)\s*$", text, re.DOTALL | re.MULTILINE)
+    block_tmp = re.findall(r"/\*{2}\s*([^*]*\*(?:[^/*][^*]*\*+)*)/\s*#define\s+(.*?)\s*?$", text, re.MULTILINE)
     for comment, define in block_tmp:
-        block.append((" ".join(re.findall("^\s*\*?\s*(.*?)\s*?$", comment, re.MULTILINE)), define))
-    block += re.findall("/{3}<?\s*(.*)\s*#define\s+(.*)\s*?$", text, re.MULTILINE)
-    return block
\ No newline at end of file
+        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)
+    return block