10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-09-01 09:13:40 +02:00

Corrected bug with += in strings

This commit is contained in:
Anthony Scemama 2015-11-26 16:50:03 +01:00
parent e7f9ec3075
commit 3729312876

View File

@ -366,7 +366,12 @@ def add_operators(text):
result = [] result = []
for line in text: for line in text:
buffer = line.text buffer = line.text
if "+=" in buffer: ls = buffer.strip()
if ls.startswith('print ') or \
ls.startswith('print*') or \
ls.startswith('write('):
pass
elif "+=" in buffer:
if buffer.lstrip().startswith("if "): if buffer.lstrip().startswith("if "):
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)