X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=1376942ace266bca2a332e7672f06fa386306a42;hb=c060a764f49cecbc4724a37e32c899e23853a91e;hp=428e11e6a3ad125f69c8ee71eb6364c482ef4554;hpb=1ebf147629d5ac01251a964ad5a2f498f487091c;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 428e11e6..1376942a 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -95,9 +95,92 @@ 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}