#NEWLINE# def checkDestructuring( tokenizer , staticContext , node , simpleNamesOnly = None , data = None ) : #NEWLINE# #INDENT# if ( node . type == 'array_comp' ) : #NEWLINE# #INDENT# raise SyntaxError ( 'Invalid array comprehension left-hand side' , tokenizer ) #NEWLINE# #UNINDENT# if ( ( node . type != 'array_init' ) and ( node . type != 'object_init' ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# builder = staticContext . builder #NEWLINE# for child in node : #NEWLINE# #INDENT# if ( child == None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( child . type == 'property_init' ) : #NEWLINE# #INDENT# lhs = child [ 0 ] #NEWLINE# rhs = child [ 1 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lhs = None #NEWLINE# rhs = None #NEWLINE# #UNINDENT# if ( rhs and ( ( rhs . type == 'array_init' ) or ( rhs . type == 'object_init' ) ) ) : #NEWLINE# #INDENT# checkDestructuring ( tokenizer , staticContext , rhs , simpleNamesOnly , data ) #NEWLINE# #UNINDENT# if ( lhs and simpleNamesOnly ) : #NEWLINE# #INDENT# if ( lhs . type != 'identifier' ) : #NEWLINE# #INDENT# raise SyntaxError ( 'Missing name in pattern' , tokenizer ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if data : #NEWLINE# #INDENT# childNode = builder . DECL_build ( tokenizer ) #NEWLINE# builder . DECL_setName ( childNode , lhs . value ) #NEWLINE# builder . DECL_finish ( childNode )