X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=50758645a78459a7336cecd5622ecf04baf24c0e;hb=70736533af22afef6727cedb0f75504f98688cad;hp=dfcaf68f73777f268f0887199f1d87d64c5354b7;hpb=898f487776366dc434242110cfeebe160eb3e05b;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index dfcaf68f..50758645 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -95,19 +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*?(?!/{3}<.*?)$", 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}