Commit 7a99178e by sikang

bug fix

parent 74c6ada4
...@@ -159,16 +159,16 @@ class JavaGarble: ...@@ -159,16 +159,16 @@ class JavaGarble:
for fun in self.__functions: for fun in self.__functions:
line +="%s\n"% fun line +="%s\n"% fun
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("{")
curly_braces -= line.count("}") curly_braces -= line.count("}")
#一个花括号表示在方法的直接作用域内 #一个花括号表示在方法的直接作用域内
if curly_braces == 1: if curly_braces == 1:
curly_braces += line.count("{")
curly_braces -= line.count("}")
if "return" in line: if "return" in line:
curly_braces = -10000 curly_braces = -10000
continue continue
......
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