Changeset: 14a8e3730764 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=14a8e3730764
Modified Files:
testing/exportutils.py
Branch: default
Log Message:
Merge with Aug2018 branch.
diffs (38 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'\)'
@@ -104,8 +104,8 @@ def replace(line, defines, tried):
pos = res2.start(0) + len(repl[arg])
bd = bd[:res2.start(0)] + repl[arg] + bd[res2.end(0):]
res2 = r2.search(bd, pos)
+ bd = bd.replace('##', '')
bd, changed = replace(bd, defines, tried + [name])
- bd = bd.replace('##', '')
line = line[:res.start(0)] + bd + line[res.end(0):]
res = r.search(line, res.start(0) + len(bd))
return line, changed
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list