Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gsalzer authored Oct 30, 2024
1 parent 2bbc3a2 commit 31c3e6b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mythril/ethereum/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,31 +178,31 @@ def parse_pragma(solidity_code):
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)
if not m:
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


Expand Down

0 comments on commit 31c3e6b

Please sign in to comment.