Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–163 unchanged (163 lines)
164 aliasReference, aliasDefinition.cloneTree());
165 }
166 }
167
168 private class AliasedTypeNode implements AliasUsage {
169 private final Node typeReference;
170 private final String aliasName;
171
172 AliasedTypeNode(Node typeReference,
173 String aliasName) {
174 this.typeReference = typeReference;
175 this.aliasName = aliasName;
176 }
177
178 @Override
179 public void applyAlias() {
180 typeReference.setString(aliasName);
181 }
182 }
183
184
185 private class Traversal implements NodeTraversal.ScopedCallback {
186 // The job of this class is to collect these three data sets.
…lines 187–461 unchanged (275 lines)
462 endIndex = name.length();
463 }
464 String baseName = name.substring(0, endIndex);
465 Var aliasVar = aliases.get(baseName);
466 if (aliasVar != null) {
467 Node aliasedNode = aliasVar.getInitialValue();
468 aliasUsages.add(new AliasedTypeNode(typeNode, aliasedNode.getQualifiedName() + name.substring(endIndex)));
469 }
470 }
471
472 for (Node child = typeNode.getFirstChild(); child != null;
473 child = child.getNext()) {
474 fixTypeNode(child);
…lines 475–479 unchanged (5 lines)

After

…lines 1–163 unchanged (163 lines)
164 aliasReference, aliasDefinition.cloneTree());
165 }
166 }
167
168 private class AliasedTypeNode implements AliasUsage {
169 private final Node typeReference;
170 private final Node aliasDefinition;
171 private final String aliasName;
172
173 AliasedTypeNode(Node typeReference, Node aliasDefinition,
174 String aliasName) {
175 this.typeReference = typeReference;
176 this.aliasDefinition = aliasDefinition;
177 this.aliasName = aliasName;
178 }
179
180 @Override
181 public void applyAlias() {
182 String typeName = typeReference.getString();
183 String aliasExpanded =
184 Preconditions.checkNotNull(aliasDefinition.getQualifiedName());
185 Preconditions.checkState(typeName.startsWith(aliasName));
186 typeReference.setString(typeName.replaceFirst(aliasName, aliasExpanded));
187 }
188 }
189
190
191 private class Traversal implements NodeTraversal.ScopedCallback {
192 // The job of this class is to collect these three data sets.
…lines 193–467 unchanged (275 lines)
468 endIndex = name.length();
469 }
470 String baseName = name.substring(0, endIndex);
471 Var aliasVar = aliases.get(baseName);
472 if (aliasVar != null) {
473 Node aliasedNode = aliasVar.getInitialValue();
474 aliasUsages.add(new AliasedTypeNode(typeNode, aliasedNode, baseName));
475 }
476 }
477
478 for (Node child = typeNode.getFirstChild(); child != null;
479 child = child.getNext()) {
480 fixTypeNode(child);
…lines 481–485 unchanged (5 lines)

Before

program
block_comment "/*\n * Copyright 2010 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Maps"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CompilerOptions"
. "."
identifier "AliasTransformation"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CompilerOptions"
. "."
identifier "AliasTransformationHandler"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "SourcePosition"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
block_comment "/**\n * Process aliases in goog.scope blocks.\n *\n * goog.scop"...
class_declaration
class "class"
identifier "ScopedAliases"
super_interfaces
implements "implements"
type_list
type_identifier "HotSwapCompilerPass"
class_body
{ "{"
block_comment "/** Name used to denote an scoped function block used for al"...
field_declaration
modifiers
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "SCOPING_METHOD_NAME"
= "="
string_literal
" "\""
string_fragment "goog.scope"
" "\""
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "PreprocessorSymbolTable"
variable_declarator
identifier "preprocessorSymbolTable"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AliasTransformationHandler"
variable_declarator
identifier "transformationHandler"
; ";"
line_comment "// Errors"
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
constructor_declaration (+50 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+329 nodes collapsed)
interface_declaration
modifiers
private "private"
interface "interface"
identifier "AliasUsage"
interface_body
{ "{"
method_declaration
modifiers
public "public"
void_type "void"
identifier "applyAlias"
formal_parameters
( "("
) ")"
; ";"
} "}"
class_declaration (+99 nodes collapsed)
class_declaration
modifiers
private "private"
class "class"
identifier "AliasedTypeNode"
super_interfaces
implements "implements"
type_list
type_identifier "AliasUsage"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Node"
variable_declarator
identifier "typeReference"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "aliasName"
; ";"
constructor_declaration
identifier "AliasedTypeNode"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "typeReference"
, ","
formal_parameter
type_identifier "String"
identifier "aliasName"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "typeReference"
= "="
identifier "typeReference"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "aliasName"
= "="
identifier "aliasName"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "applyAlias"
formal_parameters
( "("
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "typeReference"
. "."
identifier "setString"
argument_list
( "("
identifier "aliasName"
) ")"
; ";"
} "}"
} "}"
class_declaration
modifiers
private "private"
class "class"
identifier "Traversal"
super_interfaces
implements "implements"
type_list
scoped_type_identifier
type_identifier "NodeTraversal"
. "."
type_identifier "ScopedCallback"
class_body
{ "{"
line_comment "// The job of this class is to collect these three data sets"...
line_comment "// The order of this list determines the order that aliases "...
field_declaration (+21 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration (+21 nodes collapsed)
line_comment "// This map is temporary and cleared for each scope."
field_declaration (+23 nodes collapsed)
line_comment "// Suppose you create an alias."
line_comment "// var x = goog.x;"
line_comment "// As a side-effect, this means you can shadow the namespace"...
line_comment "// in inner scopes. When we inline the namespaces, we have t"...
line_comment "// these shadows."
line_comment "//"
line_comment "// Fortunately, we already have a name uniquifier that runs "...
line_comment "// normalization (before optimizations). We run it here on a"...
line_comment "// set of variables, but only as a last resort (because this"...
line_comment "// up warning messages downstream)."
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "hasNamespaceShadows"
= "="
false "false"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "hasErrors"
= "="
false "false"
; ";"
field_declaration
modifiers
private "private"
type_identifier "AliasTransformation"
variable_declarator
identifier "transformation"
= "="
null_literal "null"
; ";"
method_declaration
generic_type
type_identifier "Collection"
type_arguments
< "<"
type_identifier "Node"
> ">"
identifier "getAliasDefinitionsInOrder"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "aliasDefinitionsInOrder"
; ";"
} "}"
method_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "AliasUsage"
> ">"
identifier "getAliasUsages"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "aliasUsages"
; ";"
} "}"
method_declaration
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "Node"
> ">"
identifier "getScopeCalls"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "scopeCalls"
; ";"
} "}"
method_declaration
boolean_type "boolean"
identifier "hasErrors"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "hasErrors"
; ";"
} "}"
method_declaration (+46 nodes collapsed)
method_declaration (+90 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+81 nodes collapsed)
method_declaration (+186 nodes collapsed)
method_declaration (+55 nodes collapsed)
method_declaration (+336 nodes collapsed)
block_comment "/** Find out if there are any local shadows of namespaces. *"...
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Rename any local shadows of namespaces.\n * Th"...
method_declaration (+106 nodes collapsed)
method_declaration (+201 nodes collapsed)
method_declaration (+485 nodes collapsed)
method_declaration
modifiers
private "private"
void_type "void"
identifier "fixTypeNode"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "typeNode"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "typeNode"
. "."
identifier "isString"
argument_list
( "("
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "typeNode"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "endIndex"
= "="
method_invocation
identifier "name"
. "."
identifier "indexOf"
argument_list
( "("
character_literal "'.'"
) ")"
; ";"
if_statement (+26 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "baseName"
= "="
method_invocation
identifier "name"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
identifier "endIndex"
) ")"
; ";"
local_variable_declaration
type_identifier "Var"
variable_declarator
identifier "aliasVar"
= "="
method_invocation
identifier "aliases"
. "."
identifier "get"
argument_list
( "("
identifier "baseName"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "aliasVar"
!= "!="
null_literal "null"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "aliasedNode"
= "="
method_invocation
identifier "aliasVar"
. "."
identifier "getInitialValue"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "aliasUsages"
. "."
identifier "add"
argument_list
( "("
object_creation_expression
new "new"
type_identifier "AliasedTypeNode"
argument_list
( "("
identifier "typeNode"
, ","
binary_expression
method_invocation
identifier "aliasedNode"
. "."
identifier "getQualifiedName"
argument_list
( "("
) ")"
+ "+"
method_invocation
identifier "name"
. "."
identifier "substring"
argument_list
( "("
identifier "endIndex"
) ")"
) ")"
) ")"
; ";"
} "}"
} "}"
for_statement (+43 nodes collapsed)
} "}"
} "}"
} "}"

After

program
block_comment "/*\n * Copyright 2010 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Maps"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CompilerOptions"
. "."
identifier "AliasTransformation"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "CompilerOptions"
. "."
identifier "AliasTransformationHandler"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "Scope"
. "."
identifier "Var"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "SourcePosition"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "javax"
. "."
identifier "annotation"
. "."
identifier "Nullable"
; ";"
block_comment "/**\n * Process aliases in goog.scope blocks.\n *\n * goog.scop"...
class_declaration
class "class"
identifier "ScopedAliases"
super_interfaces
implements "implements"
type_list
type_identifier "HotSwapCompilerPass"
class_body
{ "{"
block_comment "/** Name used to denote an scoped function block used for al"...
field_declaration
modifiers
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "SCOPING_METHOD_NAME"
= "="
string_literal
" "\""
string_fragment "goog.scope"
" "\""
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "PreprocessorSymbolTable"
variable_declarator
identifier "preprocessorSymbolTable"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AliasTransformationHandler"
variable_declarator
identifier "transformationHandler"
; ";"
line_comment "// Errors"
field_declaration (+25 nodes collapsed)
field_declaration (+31 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
constructor_declaration (+50 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+329 nodes collapsed)
interface_declaration
modifiers
private "private"
interface "interface"
identifier "AliasUsage"
interface_body
{ "{"
method_declaration
modifiers
public "public"
void_type "void"
identifier "applyAlias"
formal_parameters
( "("
) ")"
; ";"
} "}"
class_declaration (+99 nodes collapsed)
class_declaration
modifiers
private "private"
class "class"
identifier "AliasedTypeNode"
super_interfaces
implements "implements"
type_list
type_identifier "AliasUsage"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Node"
variable_declarator
identifier "typeReference"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Node"
variable_declarator
identifier "aliasDefinition"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "aliasName"
; ";"
constructor_declaration
identifier "AliasedTypeNode"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "typeReference"
, ","
formal_parameter
type_identifier "Node"
identifier "aliasDefinition"
, ","
formal_parameter
type_identifier "String"
identifier "aliasName"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "typeReference"
= "="
identifier "typeReference"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "aliasDefinition"
= "="
identifier "aliasDefinition"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "aliasName"
= "="
identifier "aliasName"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "applyAlias"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "typeName"
= "="
method_invocation
identifier "typeReference"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "aliasExpanded"
= "="
method_invocation
identifier "Preconditions"
. "."
identifier "checkNotNull"
argument_list
( "("
method_invocation
identifier "aliasDefinition"
. "."
identifier "getQualifiedName"
argument_list
( "("
) ")"
) ")"
; ";"
expression_statement
method_invocation
identifier "Preconditions"
. "."
identifier "checkState"
argument_list
( "("
method_invocation
identifier "typeName"
. "."
identifier "startsWith"
argument_list
( "("
identifier "aliasName"
) ")"
) ")"
; ";"
expression_statement
method_invocation
identifier "typeReference"
. "."
identifier "setString"
argument_list
( "("
method_invocation
identifier "typeName"
. "."
identifier "replaceFirst"
argument_list
( "("
identifier "aliasName"
, ","
identifier "aliasExpanded"
) ")"
) ")"
; ";"
} "}"
} "}"
class_declaration
modifiers
private "private"
class "class"
identifier "Traversal"
super_interfaces
implements "implements"
type_list
scoped_type_identifier
type_identifier "NodeTraversal"
. "."
type_identifier "ScopedCallback"
class_body
{ "{"
line_comment "// The job of this class is to collect these three data sets"...
line_comment "// The order of this list determines the order that aliases "...
field_declaration (+21 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration (+21 nodes collapsed)
line_comment "// This map is temporary and cleared for each scope."
field_declaration (+23 nodes collapsed)
line_comment "// Suppose you create an alias."
line_comment "// var x = goog.x;"
line_comment "// As a side-effect, this means you can shadow the namespace"...
line_comment "// in inner scopes. When we inline the namespaces, we have t"...
line_comment "// these shadows."
line_comment "//"
line_comment "// Fortunately, we already have a name uniquifier that runs "...
line_comment "// normalization (before optimizations). We run it here on a"...
line_comment "// set of variables, but only as a last resort (because this"...
line_comment "// up warning messages downstream)."
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "hasNamespaceShadows"
= "="
false "false"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "hasErrors"
= "="
false "false"
; ";"
field_declaration
modifiers
private "private"
type_identifier "AliasTransformation"
variable_declarator
identifier "transformation"
= "="
null_literal "null"
; ";"
method_declaration
generic_type
type_identifier "Collection"
type_arguments
< "<"
type_identifier "Node"
> ">"
identifier "getAliasDefinitionsInOrder"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "aliasDefinitionsInOrder"
; ";"
} "}"
method_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "AliasUsage"
> ">"
identifier "getAliasUsages"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "aliasUsages"
; ";"
} "}"
method_declaration
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "Node"
> ">"
identifier "getScopeCalls"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "scopeCalls"
; ";"
} "}"
method_declaration
boolean_type "boolean"
identifier "hasErrors"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "hasErrors"
; ";"
} "}"
method_declaration (+46 nodes collapsed)
method_declaration (+90 nodes collapsed)
method_declaration (+99 nodes collapsed)
method_declaration (+81 nodes collapsed)
method_declaration (+186 nodes collapsed)
method_declaration (+55 nodes collapsed)
method_declaration (+336 nodes collapsed)
block_comment "/** Find out if there are any local shadows of namespaces. *"...
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Rename any local shadows of namespaces.\n * Th"...
method_declaration (+106 nodes collapsed)
method_declaration (+201 nodes collapsed)
method_declaration (+485 nodes collapsed)
method_declaration
modifiers
private "private"
void_type "void"
identifier "fixTypeNode"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "typeNode"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "typeNode"
. "."
identifier "isString"
argument_list
( "("
) ")"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "typeNode"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "endIndex"
= "="
method_invocation
identifier "name"
. "."
identifier "indexOf"
argument_list
( "("
character_literal "'.'"
) ")"
; ";"
if_statement (+26 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "baseName"
= "="
method_invocation
identifier "name"
. "."
identifier "substring"
argument_list
( "("
decimal_integer_literal "0"
, ","
identifier "endIndex"
) ")"
; ";"
local_variable_declaration
type_identifier "Var"
variable_declarator
identifier "aliasVar"
= "="
method_invocation
identifier "aliases"
. "."
identifier "get"
argument_list
( "("
identifier "baseName"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "aliasVar"
!= "!="
null_literal "null"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "aliasedNode"
= "="
method_invocation
identifier "aliasVar"
. "."
identifier "getInitialValue"
argument_list
( "("
) ")"
; ";"
expression_statement
method_invocation
identifier "aliasUsages"
. "."
identifier "add"
argument_list
( "("
object_creation_expression
new "new"
type_identifier "AliasedTypeNode"
argument_list
( "("
identifier "typeNode"
, ","
identifier "aliasedNode"
, ","
identifier "baseName"
) ")"
) ")"
; ";"
} "}"
} "}"
for_statement (+43 nodes collapsed)
} "}"
} "}"
} "}"