Fix formatting

pull/1887/head
Gernot Salzer 3 weeks ago committed by GitHub
parent 2bbc3a2120
commit 31c3e6b49e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 14
      mythril/ethereum/util.py

@ -178,7 +178,7 @@ QUOTE_END = re.compile("(?<!\\\\)'")
DQUOTE_END = re.compile('(?<!\\\\)"')
def remove_comments_strings(prg):
todo = "\n".join(prg) # normalize line ends
todo = "\n".join(prg) # normalize line ends
done = ""
while True:
m = VOID_START.search(todo)
@ -186,23 +186,23 @@ def remove_comments_strings(prg):
done += todo
break
else:
done += todo[:m.start()]
done += todo[: m.start()]
if m[0] == "//":
end = todo.find('\n', m.end())
end = todo.find("\n", m.end())
todo = "" if end == -1 else todo[end:]
elif m[0] == "/*":
end = todo.find("*/", m.end())
done += " "
todo = "" if end == -1 else todo[end+2:]
todo = "" if end == -1 else todo[end + 2 :]
else:
if m[0] == "'":
m2 = QUOTE_END.search(todo[m.end():])
m2 = QUOTE_END.search(todo[m.end() :])
else:
m2 = DQUOTE_END.search(todo[m.end():])
m2 = DQUOTE_END.search(todo[m.end() :])
if not m2:
# unclosed string
break
todo = todo[m.end()+m2.end():]
todo = todo[m.end() + m2.end() :]
return done

Loading…
Cancel
Save