mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-21 20:03:33 +01:00
Bug in touch of multiple variables
This commit is contained in:
parent
90c16dc7f5
commit
45b328c442
@ -81,9 +81,9 @@ def check_touch(line,vars,main_vars):
|
|||||||
return [main_var]+x.others
|
return [main_var]+x.others
|
||||||
all_others = make_single(flatten( map(fun,main_vars) ))
|
all_others = make_single(flatten( map(fun,main_vars) ))
|
||||||
all_others.sort()
|
all_others.sort()
|
||||||
if len(all_others) == len(vars):
|
vars.sort()
|
||||||
vars.sort()
|
print vars
|
||||||
for x,y in zip(vars,all_others):
|
for x,y in zip(vars,all_others):
|
||||||
if x != y:
|
if x != y:
|
||||||
message = "The following entities should be touched:\n"
|
message = "The following entities should be touched:\n"
|
||||||
message = "\n".join([message]+map(lambda x: "- %s"%(x,),all_others))
|
message = "\n".join([message]+map(lambda x: "- %s"%(x,),all_others))
|
||||||
|
@ -355,15 +355,24 @@ def add_operators(text):
|
|||||||
for line in text:
|
for line in text:
|
||||||
buffer = line.text
|
buffer = line.text
|
||||||
if "+=" in buffer:
|
if "+=" in buffer:
|
||||||
if buffer.lstrip().startswith("if "):
|
if "if" in buffer:
|
||||||
re_incr = re.compile(r"(.*)(\))(\s*)(.*)(\+=)(.*$)",re.S)
|
re_incr = re.compile(r"(.*)(\))(\s*)(.*)(\+=)(.*$)",re.S)
|
||||||
line.text = re.sub(re_incr,r'\1\2\4=\4+(\6)', buffer)
|
line.text = re.sub(re_incr,r'\1\2\4=\4+(\6)', buffer)
|
||||||
else:
|
else:
|
||||||
line.text = re.sub(re_incr,r'\1\2=\2+(\4)', buffer)
|
line.text = re.sub(re_incr,r'\1\2=\2+(\4)', buffer)
|
||||||
elif "-=" in 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:
|
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)
|
result.append(line)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user