#NEWLINE# def _ProcessBlock( self , context , global_alias_map ) : #NEWLINE# #INDENT# 'Scans a goog.scope block to find aliases and mark alias tokens.' #NEWLINE# alias_map = global_alias_map . copy ( ) #NEWLINE# seen_contexts = set ( ) #NEWLINE# token = context . start_token #NEWLINE# while ( token and self . _IsTokenInParentBlock ( token , context ) ) : #NEWLINE# #INDENT# token_context = ( token . metadata . context if token . metadata else None ) #NEWLINE# if ( token_context and ( token_context not in seen_contexts ) ) : #NEWLINE# #INDENT# seen_contexts . add ( token_context ) #NEWLINE# if ( ( token_context . type == ecmametadatapass . EcmaContext . VAR ) and scopeutil . IsGoogScopeBlock ( token_context . parent . parent ) ) : #NEWLINE# #INDENT# match = scopeutil . MatchAlias ( token_context ) #NEWLINE# if match : #NEWLINE# #INDENT# ( alias , symbol ) = match #NEWLINE# symbol = ( _GetAliasForIdentifier ( symbol , alias_map ) or symbol ) #NEWLINE# if scopeutil . IsInClosurizedNamespace ( symbol , self . _closurized_namespaces ) : #NEWLINE# #INDENT# alias_map [ alias ] = symbol #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( token . type is javascripttokens . JavaScriptTokenType . SIMPLE_LVALUE ) or ( token . type is javascripttokens . JavaScriptTokenType . IDENTIFIER ) ) : #NEWLINE# #INDENT# identifier = tokenutil . GetIdentifierForToken ( token ) #NEWLINE# if identifier : #NEWLINE# #INDENT# aliased_symbol = _GetAliasForIdentifier ( identifier , alias_map ) #NEWLINE# if aliased_symbol : #NEWLINE# #INDENT# token . metadata . aliased_symbol = aliased_symbol #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( token . type == javascripttokens . JavaScriptTokenType . DOC_FLAG ) : #NEWLINE# #INDENT# flag = token . attached_object #NEWLINE# if ( flag and flag . HasType ( ) and flag . jstype ) : #NEWLINE# #INDENT# _SetTypeAlias ( flag . jstype , alias_map ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# token = token . next