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