X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=e8033d7d8e564815a949781a5cc3a915c1a2e66b;hb=8c583d29bc943d84345d0078cb31d2b6fbaa53f4;hp=428e11e6a3ad125f69c8ee71eb6364c482ef4554;hpb=1ebf147629d5ac01251a964ad5a2f498f487091c;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 428e11e6..e8033d7d 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -95,9 +95,53 @@ def getInfos(definition): return D def getDefinitionBlocks(text): + """ + Take a text and return a list of tuple (description, name-value). + """ 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*?(?:/{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}