Changeset: 48904cdb1465 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=48904cdb1465 Modified Files: testing/exportutils.py Branch: Aug2018 Log Message:
Move unchanging calculation out of loop. diffs (28 lines): diff --git a/testing/exportutils.py b/testing/exportutils.py --- a/testing/exportutils.py +++ b/testing/exportutils.py @@ -61,18 +61,18 @@ def preprocess(data): def replace(line, defines, tried): changed = False + # match argument to macro with optionally several levels + # of parentheses + if deepnesting: # optionally deeply nested parentheses + nested = r'(?:\([^()]*(?:\([^()]*(?:\([^()]*(?:\([^()]*(?:\([^()]*(?:\([^()]*\)[^()]*)*\)[^()]*)*\)[^()]*)*\)[^()]*)*\)[^()]*)*\)[^()]*)*' + else: + nested = '' for name, (args, body) in defines.items(): if name in tried: continue pat = r'\b%s\b' % name sep = r'\(' for arg in args: - # match argument to macro with optionally several levels - # of parentheses - if deepnesting: # optionally deeply nested parentheses - nested = r'(?:\([^()]*(?:\([^()]*(?:\([^()]*(?:\([^()]*(?:\([^()]*(?:\([^()]*\)[^()]*)*\)[^()]*)*\)[^()]*)*\)[^()]*)*\)[^()]*)*\)[^()]*)*' - else: - nested = '' pat = pat + sep + r'([^,()]*(?:\([^()]*' + nested + r'\)[^,()]*)*)' sep = ',' pat += r'\)' _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list