@@ -129,7 +129,12 @@ def acceptType(self, node, memo):
129129 acceptAt = makeAcceptType ('at' )
130130 acceptClass = makeAcceptType ('klass' )
131131 acceptEnum = makeAcceptType ('enum' )
132- acceptInterface = makeAcceptType ('interface' )
132+ _acceptInterface = makeAcceptType ('interface' )
133+
134+ def acceptInterface (self , node , memo ):
135+ module = self .parents (lambda x :x .isModule ).next ()
136+ module .needsAbstractHelpers = True
137+ return self ._acceptInterface (node , memo )
133138
134139
135140class Module (TypeAcceptor , Base ):
@@ -228,7 +233,10 @@ def acceptVarDeclaration(self, node, memo):
228233 if node .firstChildOfType (tokens .TYPE ).firstChildOfType (tokens .ARRAY_DECLARATOR_LIST ):
229234 val = assgnExp .pushRight ('[]' )
230235 else :
231- val = assgnExp .pushRight ('{0}()' .format (identExp .type ))
236+ if node .firstChildOfType (tokens .TYPE ).firstChild ().type != tokens .QUALIFIED_TYPE_IDENT :
237+ val = assgnExp .pushRight ('{0}()' .format (identExp .type ))
238+ else :
239+ val = assgnExp .pushRight ('None' )
232240 return self
233241
234242
@@ -358,7 +366,7 @@ class Interface(Class):
358366 """ Interface -> accepts AST branches for Java interfaces. """
359367
360368
361- class MethodContent (Base ):
369+ class MethodContent (VarAcceptor , Base ):
362370 """ MethodContent -> accepts trees for blocks within methods. """
363371
364372 def acceptAssert (self , node , memo ):
@@ -399,6 +407,10 @@ def acceptCatch(self, node, memo):
399407
400408 def acceptContinue (self , node , memo ):
401409 """ Accept and process a continue statement. """
410+ parent = node .parents (lambda x : x .type in {tokens .FOR , tokens .FOR_EACH , tokens .DO , tokens .WHILE }).next ()
411+ if parent .type == tokens .FOR :
412+ updateStat = self .factory .expr (parent = self )
413+ updateStat .walk (parent .firstChildOfType (tokens .FOR_UPDATE ), memo )
402414 contStat = self .factory .statement ('continue' , fs = FS .lsr , parent = self )
403415 if len (node .children ):
404416 warn ('Detected unhandled continue statement with label; generated code incorrect.' )
@@ -517,7 +529,7 @@ def acceptSwitch(self, node, memo):
517529 # we have at least one node...
518530 parExpr = self .factory .expr (parent = self )
519531 parExpr .walk (parNode , memo )
520- eqFs = FS .l + '== ' + FS .r
532+ eqFs = FS .l + ' == ' + FS .r
521533 for caseIdx , caseNode in enumerate (caseNodes ):
522534 isDefault , isFirst = caseNode .type == tokens .DEFAULT , caseIdx == 0
523535
@@ -613,7 +625,7 @@ def acceptWhile(self, node, memo):
613625 whileStat .walk (blkNode , memo )
614626
615627
616- class Method (VarAcceptor , ModifiersAcceptor , MethodContent ):
628+ class Method (ModifiersAcceptor , MethodContent ):
617629 """ Method -> accepts AST branches for method-level objects. """
618630
619631 def acceptFormalParamStdDecl (self , node , memo ):
@@ -835,7 +847,7 @@ def acceptThisConstructorCall(self, node, memo):
835847
836848 def acceptStaticArrayCreator (self , node , memo ):
837849 """ Accept and process a static array expression. """
838- self .right = self .factory .expr (fs = '[None]* {left}' )
850+ self .right = self .factory .expr (fs = '[None] * {left}' )
839851 self .right .left = self .factory .expr ()
840852 self .right .left .walk (node .firstChildOfType (tokens .EXPR ), memo )
841853
0 commit comments