#NEWLINE# def Merge( self , block , namespace = None ) : #NEWLINE# #INDENT# 'Merges a block with the module.' #NEWLINE# typ = block . locals . get ( 'type' ) #NEWLINE# if ( not typ ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( typ is True ) : #NEWLINE# #INDENT# raise error . AmbiguousBlock #NEWLINE# #UNINDENT# block . Local ( namespace = namespace ) #NEWLINE# if ( 'order' in block . globals ) : #NEWLINE# #INDENT# if ( self . order is not None ) : #NEWLINE# #INDENT# raise error . RedundantControl ( 'order' ) #NEWLINE# #UNINDENT# self . order = block . globals [ 'order' ] #NEWLINE# #UNINDENT# self . plugin . Merge ( block ) #NEWLINE# block_id = block . locals . get ( 'id' ) #NEWLINE# if ( typ == vimdoc . SECTION ) : #NEWLINE# #INDENT# if ( ( block_id not in self . sections ) or self . sections [ block_id ] . IsDefault ( ) ) : #NEWLINE# #INDENT# self . sections [ block_id ] = block #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not block . IsDefault ( ) ) : #NEWLINE# #INDENT# raise error . DuplicateSection ( block_id ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( typ == vimdoc . BACKMATTER ) : #NEWLINE# #INDENT# if ( ( block_id not in self . backmatters ) or self . backmatters [ block_id ] . IsDefault ( ) ) : #NEWLINE# #INDENT# self . backmatters [ block_id ] = block #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not block . IsDefault ( ) ) : #NEWLINE# #INDENT# raise error . DuplicateBackmatter ( block_id ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# collection_type = self . plugin . GetCollectionType ( block ) #NEWLINE# if ( collection_type is not None ) : #NEWLINE# #INDENT# self . collections . setdefault ( collection_type , [ ] ) . append ( block )