From 45b328c442e516ef78b38957d8c0d72c2d2c6d72 Mon Sep 17 00:00:00 2001 From: vijaygopalchilkuri Date: Tue, 9 Jul 2013 18:06:16 +0200 Subject: [PATCH 1/2] Bug in touch of multiple variables --- src/parsed_text.py | 6 +++--- src/preprocessed_text.py | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/parsed_text.py b/src/parsed_text.py index 6338061..2c07ad1 100644 --- a/src/parsed_text.py +++ b/src/parsed_text.py @@ -81,9 +81,9 @@ def check_touch(line,vars,main_vars): return [main_var]+x.others all_others = make_single(flatten( map(fun,main_vars) )) all_others.sort() - if len(all_others) == len(vars): - vars.sort() - for x,y in zip(vars,all_others): + vars.sort() + print vars + for x,y in zip(vars,all_others): if x != y: message = "The following entities should be touched:\n" message = "\n".join([message]+map(lambda x: "- %s"%(x,),all_others)) diff --git a/src/preprocessed_text.py b/src/preprocessed_text.py index 7e7ae4a..5d47938 100644 --- a/src/preprocessed_text.py +++ b/src/preprocessed_text.py @@ -355,15 +355,24 @@ def add_operators(text): for line in text: buffer = line.text if "+=" in buffer: - if buffer.lstrip().startswith("if "): + if "if" in buffer: re_incr = re.compile(r"(.*)(\))(\s*)(.*)(\+=)(.*$)",re.S) line.text = re.sub(re_incr,r'\1\2\4=\4+(\6)', buffer) else: line.text = re.sub(re_incr,r'\1\2=\2+(\4)', buffer) elif "-=" in buffer: - line.text = re.sub(re_decr,r'\1\2=\2-(\4)', buffer) + if "if" in buffer: + re_decr = re.compile(r"(.*)(\))(\s*)(.*)(\-=)(.*$)",re.S) + line.text = re.sub(re_decr,r'\1\2\4=\4-(\6)', buffer) + else: + line.text = re.sub(re_decr,r'\1\2=\2-(\4)', buffer) +# line.text = re.sub(re_decr,r'\1\2=\2-(\4)', buffer) elif "*=" in buffer: - line.text = re.sub(re_mult,r'\1\2=\2*(\4)', buffer) + if "if" in buffer: + re_mult = re.compile(r"(.*)(\))(\s*)(.*)(\*=)(.*$)",re.S) + line.text = re.sub(re_mult,r'\1\2\4=\4*(\6)', buffer) + else: + line.text = re.sub(re_mult,r'\1\2=\2*(\4)', buffer) result.append(line) return result From 27a799df3549df4e8a6532212a86d897e810d522 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 11 Jul 2013 00:40:20 +0200 Subject: [PATCH 2/2] Openmp bug Version:1.2.21 --- src/command_line.py | 1 + src/preprocessed_text.py | 1 - src/version.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command_line.py b/src/command_line.py index 4aba685..f25e81b 100644 --- a/src/command_line.py +++ b/src/command_line.py @@ -51,6 +51,7 @@ options['u'] = [ 'unused' , 'Print unused providers', 0 ] class CommandLine(object): + do_openmp = False def __init__(self): global options self._opts = None diff --git a/src/preprocessed_text.py b/src/preprocessed_text.py index 5d47938..50a4652 100644 --- a/src/preprocessed_text.py +++ b/src/preprocessed_text.py @@ -671,7 +671,6 @@ def change_includes(text): if type(line) == Include: txt = line.text.replace('"',"'").split("'") if len(txt) != 3: - print txt error.fail(line,"Error in include statement") filename = txt[1].strip() try: diff --git a/src/version.py b/src/version.py index ea274a4..6d399f3 100644 --- a/src/version.py +++ b/src/version.py @@ -1 +1 @@ -version = "1.2.20" +version = "1.2.21"