#NEWLINE# def _parse_fields( self , cls , next_line ) : #NEWLINE# #INDENT# labels = self . expect_list ( ) #NEWLINE# descriptors = iter_descriptors ( cls ) #NEWLINE# label_to_name = { descriptor . label : name for ( name , descriptor ) in descriptors } #NEWLINE# index_to_name = { index : label_to_name [ label ] for ( index , label ) in enumerate ( labels ) } #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# values = self . expect_list ( ) #NEWLINE# #UNINDENT# except ParsingError as list_error : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . rollback ( ) #NEWLINE# self . expect_line ( next_line ) #NEWLINE# #UNINDENT# except ParsingError as line_error : #NEWLINE# #INDENT# raise ParsingError ( * ( list_error . args + line_error . args ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# instance = cls ( ) #NEWLINE# for ( index , value ) in enumerate ( values ) : #NEWLINE# #INDENT# name = index_to_name [ index ] #NEWLINE# setattr ( instance , name , descriptor ) #NEWLINE# #UNINDENT# ( yield instance )