Commit ba0aeb8c by sikang

bug fix

parent f0115386
...@@ -154,7 +154,7 @@ class JavaGarble: ...@@ -154,7 +154,7 @@ class JavaGarble:
if curly_braces >= 1: if curly_braces >= 1:
curly_braces += line.count("{") curly_braces += line.count("{")
curly_braces -= line.count("}") curly_braces -= line.count("}")
# 定位1个缩进开头的类方法 # 定位1个缩进开头的类方法
if line.startswith(" ") and not line.startswith(" ") and ("){\n" in line or ") {\n" in line): if line.startswith(" ") and not line.startswith(" ") and ("){\n" in line or ") {\n" in line):
curly_braces = line.count("{") curly_braces = line.count("{")
...@@ -164,8 +164,8 @@ class JavaGarble: ...@@ -164,8 +164,8 @@ class JavaGarble:
if "return" in line: if "return" in line:
curly_braces = -10000 curly_braces = -10000
continue continue
if ";\n" in line and len(line) > 10: if ";\n" in line and len(line.replace(" ","")) > 10:
line += "\n%s" % self.__insert_code() line += self.__insert_code()
fout.write(line) fout.write(line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment