parameters: (context)
docstring: Match an alias statement in a goog.module style import.
  
    Example alias: var MyClass = goog.require('proj.longNamespace.MyClass').
  
    Args:
      context: An EcmaContext.
  
    Returns:
      If a valid alias, returns a tuple of alias and symbol, otherwise None.
docstring_summary: Match an alias statement in a goog.module style import.
docstring_tokens: Match an alias statement in a goog . module style import .
function: def MatchModuleAlias(context):
    """Match an alias statement in a goog.module style import.
  
    Example alias: var MyClass = goog.require('proj.longNamespace.MyClass').
  
    Args:
      context: An EcmaContext.
  
    Returns:
      If a valid alias, returns a tuple of alias and symbol, otherwise None.
    """
    code_tokens = _GetVarAssignmentTokens(context)
    if code_tokens is None:
      return
  
    if(code_tokens[3].IsType(JavaScriptTokenType.IDENTIFIER) and
       code_tokens[3].string == 'goog.require'):
      # var Foo = goog.require('bar.Foo');
      alias = code_tokens[1]
      symbol = tokenutil.GetStringAfterToken(code_tokens[3])
      if symbol:
        alias.metadata.is_alias_definition = True
        return alias.string, symbol
function_tokens: def MatchModuleAlias ( context ) : code_tokens = _GetVarAssignmentTokens ( context ) if code_tokens is None : return if ( code_tokens [ 3 ] . IsType ( JavaScriptTokenType . IDENTIFIER ) and code_tokens [ 3 ] . string == 'goog.require' ) : # var Foo = goog.require('bar.Foo'); alias = code_tokens [ 1 ] symbol = tokenutil . GetStringAfterToken ( code_tokens [ 3 ] ) if symbol : alias . metadata . is_alias_definition = True return alias . string , symbol