Skip to content

Commit

Permalink
better regex for detecting inline comments in function declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
mathialo committed May 31, 2018
1 parent 4e8099d commit 4215577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/py2by
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def reverse_parse(filename, outputname):
# Another quick fix solving the problem with inline comments, (see issue 14
# on github). This also makes the indentation style Java-style instead of
# Allman-style as before (see https://en.wikipedia.org/wiki/Indentation_style)
entire_file = re.sub(r"(#\s*[\w\d\s]*)?\n\s*{", r" {\1", entire_file)
entire_file = re.sub(r"((?:\s*#\s*.*\n?)*)?\n\s*{", r" {\1", entire_file)

# Fix issue with where the closing braces are placed. Search for places where
# the following three things appear: (newlines) ((indented) curly brace) (newline)
Expand Down

0 comments on commit 4215577

Please sign in to comment.