X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=wizard%2Fbertos_utils.py;h=479f88eea08cd3727f86cb3afcb29038cdb491ec;hb=90500b8c052f1ae5ac3870c509cd1f37786f7e3d;hp=2e55ffaaad465d216d871e08e5410fea38c3bd90;hpb=24f86275533c577c80c3ae65effb006559e670e0;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 2e55ffaa..479f88ee 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -95,18 +95,104 @@ 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}