Skip to content

Commit 0ec9dff

Browse files
committed
bug_fix support for correcting return values
Release 0.1.0 suffered from an annoying flaw, when you had code like below return ,x It could not be parsed. This bill made odd support for correcting such cases
1 parent 9ed09e1 commit 0ec9dff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/repair.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ def after_dot(t):
195195
)
196196
)
197197
return False
198+
199+
def after_return(t):
200+
return t[1] is not None and not(
201+
start_atom(t[1]) or t[1].string.isspace()
202+
)
198203
'''
199204
def after_else(t):
200205
if 60<t[0].start[0]<80:
@@ -270,6 +275,11 @@ def process_token(atok,t,l,b ):
270275
before_space = True
271276
after = after_unary(n)
272277
after_space = True
278+
elif s in ["return"]:
279+
before = False
280+
before_space = True
281+
after = after_return(n)
282+
after_space = True
273283
else:
274284
before = False
275285
before_space = False

0 commit comments

Comments
 (0)