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–87 unchanged (87 lines)
88 NodeTraversal.traverse(compiler, root, this);
89 if (MAKE_LOCAL_NAMES_UNIQUE) {
90 MakeDeclaredNamesUnique renamer = new MakeDeclaredNamesUnique();
91 NodeTraversal t = new NodeTraversal(compiler, renamer);
92 t.traverseRoots(externs, root);
93 }
94 removeDuplicateDeclarations(root);
95 new PropogateConstantAnnotations(compiler, assertOnChange)
96 .process(externs, root);
97 }
98
99 @Override
100 public boolean shouldTraverse(NodeTraversal t, Node n, Node parent) {
…lines 101–530 unchanged (430 lines)

After

…lines 1–82 unchanged (82 lines)
83 compiler.reportCodeChange();
84 }
85
86 @Override
87 public void process(Node externs, Node root) {
88 NodeTraversal.traverse(compiler, root, this);
89 removeDuplicateDeclarations(root);
90 if (MAKE_LOCAL_NAMES_UNIQUE) {
91 MakeDeclaredNamesUnique renamer = new MakeDeclaredNamesUnique();
92 NodeTraversal t = new NodeTraversal(compiler, renamer);
93 t.traverseRoots(externs, root);
94 }
95 new PropogateConstantAnnotations(compiler, assertOnChange)
…lines 96–530 unchanged (435 lines)

Before

program
block_comment "/*\n * Copyright 2008 Google Inc.\n *\n * Licensed under the Ap"...
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "Callback"
; ";"
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 "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * The goal with this pass is to simplify the other pass"...
line_comment "// public for ReplaceDebugStringsTest"
class_declaration
class "class"
identifier "Normalize"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
, ","
type_identifier "Callback"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "assertOnChange"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "CONVERT_WHILE_TO_FOR"
= "="
true "true"
; ";"
field_declaration
modifiers
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "MAKE_LOCAL_NAMES_UNIQUE"
= "="
true "true"
; ";"
constructor_declaration (+33 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "externs"
, ","
formal_parameter
type_identifier "Node"
identifier "root"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "NodeTraversal"
. "."
identifier "traverse"
argument_list
( "("
identifier "compiler"
, ","
identifier "root"
, ","
this "this"
) ")"
; ";"
if_statement (+48 nodes collapsed)
expression_statement
method_invocation
identifier "removeDuplicateDeclarations"
argument_list
( "("
identifier "root"
) ")"
; ";"
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "PropogateConstantAnnotations"
argument_list
( "("
identifier "compiler"
, ","
identifier "assertOnChange"
) ")"
. "."
identifier "process"
argument_list
( "("
identifier "externs"
, ","
identifier "root"
) ")"
; ";"
} "}"
method_declaration (+41 nodes collapsed)
class_declaration (+372 nodes collapsed)
block_comment "/**\n * Walk the AST tree and verify that constant names ar"...
class_declaration (+585 nodes collapsed)
method_declaration (+139 nodes collapsed)
block_comment "/**\n * Do normalizations that introduce new siblings or pa"...
method_declaration (+157 nodes collapsed)
line_comment "// TODO(johnlenz): Move this to NodeTypeNormalizer once the "...
line_comment "// fixed."
block_comment "/**\n * Limit the number of special cases where LABELs need"...
method_declaration (+163 nodes collapsed)
block_comment "/**\n * Bring the initializers out of FOR loops. These nee"...
method_declaration (+298 nodes collapsed)
block_comment "/**\n * Split a var node such as:\n * var a, b;\n * int"...
method_declaration (+216 nodes collapsed)
block_comment "/**\n * Move all the functions that are valid at the execut"...
method_declaration (+218 nodes collapsed)
block_comment "/**\n * @param after The child node to insert the newChild "...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * Remove duplicate VAR declarations.\n */"
method_declaration (+73 nodes collapsed)
block_comment "/**\n * ScopeCreator duplicate declaration handler.\n */"
class_declaration (+359 nodes collapsed)
block_comment "/**\n * A simple class that causes scope to be created.\n "...
class_declaration (+117 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2008 Google Inc.\n *\n * Licensed under the Ap"...
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
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "AbstractPostOrderCallback"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "NodeTraversal"
. "."
identifier "Callback"
; ";"
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 "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * The goal with this pass is to simplify the other pass"...
line_comment "// public for ReplaceDebugStringsTest"
class_declaration
class "class"
identifier "Normalize"
super_interfaces
implements "implements"
type_list
type_identifier "CompilerPass"
, ","
type_identifier "Callback"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "assertOnChange"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "CONVERT_WHILE_TO_FOR"
= "="
true "true"
; ";"
field_declaration
modifiers
static "static"
final "final"
boolean_type "boolean"
variable_declarator
identifier "MAKE_LOCAL_NAMES_UNIQUE"
= "="
true "true"
; ";"
constructor_declaration (+33 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "externs"
, ","
formal_parameter
type_identifier "Node"
identifier "root"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "NodeTraversal"
. "."
identifier "traverse"
argument_list
( "("
identifier "compiler"
, ","
identifier "root"
, ","
this "this"
) ")"
; ";"
expression_statement
method_invocation
identifier "removeDuplicateDeclarations"
argument_list
( "("
identifier "root"
) ")"
; ";"
if_statement (+48 nodes collapsed)
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "PropogateConstantAnnotations"
argument_list
( "("
identifier "compiler"
, ","
identifier "assertOnChange"
) ")"
. "."
identifier "process"
argument_list
( "("
identifier "externs"
, ","
identifier "root"
) ")"
; ";"
} "}"
method_declaration (+41 nodes collapsed)
class_declaration (+372 nodes collapsed)
block_comment "/**\n * Walk the AST tree and verify that constant names ar"...
class_declaration (+585 nodes collapsed)
method_declaration (+139 nodes collapsed)
block_comment "/**\n * Do normalizations that introduce new siblings or pa"...
method_declaration (+157 nodes collapsed)
line_comment "// TODO(johnlenz): Move this to NodeTypeNormalizer once the "...
line_comment "// fixed."
block_comment "/**\n * Limit the number of special cases where LABELs need"...
method_declaration (+163 nodes collapsed)
block_comment "/**\n * Bring the initializers out of FOR loops. These nee"...
method_declaration (+298 nodes collapsed)
block_comment "/**\n * Split a var node such as:\n * var a, b;\n * int"...
method_declaration (+216 nodes collapsed)
block_comment "/**\n * Move all the functions that are valid at the execut"...
method_declaration (+218 nodes collapsed)
block_comment "/**\n * @param after The child node to insert the newChild "...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * Remove duplicate VAR declarations.\n */"
method_declaration (+73 nodes collapsed)
block_comment "/**\n * ScopeCreator duplicate declaration handler.\n */"
class_declaration (+359 nodes collapsed)
block_comment "/**\n * A simple class that causes scope to be created.\n "...
class_declaration (+117 nodes collapsed)
} "}"