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–145 unchanged (145 lines)
146 compiler, fnNode, new MakeDeclaredNamesUnique(
147 new InlineRenamer(
148 idSupplier,
149 "inline_",
150 isCallInLoop)));
151 // Make label names unique to this instance.
152 }
153
154 static class LabelNameSupplier implements Supplier<String> {
155 final Supplier<String> idSupplier;
156
157 LabelNameSupplier(Supplier<String> idSupplier) {
158 this.idSupplier = idSupplier;
…lines 159–448 unchanged (290 lines)

After

…lines 1–145 unchanged (145 lines)
146 compiler, fnNode, new MakeDeclaredNamesUnique(
147 new InlineRenamer(
148 idSupplier,
149 "inline_",
150 isCallInLoop)));
151 // Make label names unique to this instance.
152 new RenameLabels(compiler, new LabelNameSupplier(idSupplier), false)
153 .process(null, fnNode);
154 }
155
156 static class LabelNameSupplier implements Supplier<String> {
157 final Supplier<String> idSupplier;
158
159 LabelNameSupplier(Supplier<String> idSupplier) {
…lines 160–450 unchanged (291 lines)

Before

program
block_comment "/*\n * Copyright 2009 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 "base"
. "."
identifier "Supplier"
; ";"
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 "MakeDeclaredNamesUnique"
. "."
identifier "InlineRenamer"
; ";"
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 "LinkedHashMap"
; ";"
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
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
. "."
identifier "Entry"
; ";"
block_comment "/**\n * A class to transform the body of a function into a ge"...
class_declaration
class "class"
identifier "FunctionToBlockMutator"
class_body
{ "{"
field_declaration
modifiers
private "private"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "Supplier"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "safeNameIdSupplier"
; ";"
constructor_declaration (+38 nodes collapsed)
block_comment "/**\n * @param fnName The name to use when preparing human "...
method_declaration (+284 nodes collapsed)
block_comment "/**\n * For all VAR node with uninitialized declarations, "...
method_declaration (+153 nodes collapsed)
block_comment "/**\n * Fix-up all local names to be unique for this subtre"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "makeLocalNamesUnique"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "fnNode"
, ","
formal_parameter
boolean_type "boolean"
identifier "isCallInLoop"
) ")"
block
{ "{"
local_variable_declaration
generic_type
type_identifier "Supplier"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "idSupplier"
= "="
method_invocation
identifier "compiler"
. "."
identifier "getUniqueNameIdSupplier"
argument_list
( "("
) ")"
; ";"
line_comment "// Make variable names unique to this instance."
expression_statement (+33 nodes collapsed)
line_comment "// Make label names unique to this instance."
} "}"
class_declaration (+84 nodes collapsed)
block_comment "/**\n * Create a unique label name.\n */"
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Inlines the arguments within the node tree using th"...
method_declaration (+319 nodes collapsed)
block_comment "/**\n * Convert returns to assignments and breaks, as need"...
method_declaration (+314 nodes collapsed)
block_comment "/***********************************************************"...
block_comment "/**\n * Example:\n * a = (void) 0;\n */"
method_declaration (+97 nodes collapsed)
block_comment "/**\n * Replace the 'return' statement with its child expre"...
method_declaration (+116 nodes collapsed)
block_comment "/**\n * Create a valid statement Node containing an assignm"...
method_declaration (+71 nodes collapsed)
block_comment "/**\n * Replace the 'return' statement with its child expre"...
method_declaration (+161 nodes collapsed)
block_comment "/**\n * @return Whether the given block end with an return "...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Replace the 'return' statement with its child expre"...
method_declaration (+282 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2009 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 "base"
. "."
identifier "Supplier"
; ";"
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 "MakeDeclaredNamesUnique"
. "."
identifier "InlineRenamer"
; ";"
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 "LinkedHashMap"
; ";"
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
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
. "."
identifier "Entry"
; ";"
block_comment "/**\n * A class to transform the body of a function into a ge"...
class_declaration
class "class"
identifier "FunctionToBlockMutator"
class_body
{ "{"
field_declaration
modifiers
private "private"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "Supplier"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "safeNameIdSupplier"
; ";"
constructor_declaration (+38 nodes collapsed)
block_comment "/**\n * @param fnName The name to use when preparing human "...
method_declaration (+284 nodes collapsed)
block_comment "/**\n * For all VAR node with uninitialized declarations, "...
method_declaration (+153 nodes collapsed)
block_comment "/**\n * Fix-up all local names to be unique for this subtre"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "makeLocalNamesUnique"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "fnNode"
, ","
formal_parameter
boolean_type "boolean"
identifier "isCallInLoop"
) ")"
block
{ "{"
local_variable_declaration
generic_type
type_identifier "Supplier"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "idSupplier"
= "="
method_invocation
identifier "compiler"
. "."
identifier "getUniqueNameIdSupplier"
argument_list
( "("
) ")"
; ";"
line_comment "// Make variable names unique to this instance."
expression_statement (+33 nodes collapsed)
line_comment "// Make label names unique to this instance."
expression_statement
method_invocation
object_creation_expression
new "new"
type_identifier "RenameLabels"
argument_list
( "("
identifier "compiler"
, ","
object_creation_expression
new "new"
type_identifier "LabelNameSupplier"
argument_list
( "("
identifier "idSupplier"
) ")"
, ","
false "false"
) ")"
. "."
identifier "process"
argument_list
( "("
null_literal "null"
, ","
identifier "fnNode"
) ")"
; ";"
} "}"
class_declaration (+84 nodes collapsed)
block_comment "/**\n * Create a unique label name.\n */"
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Inlines the arguments within the node tree using th"...
method_declaration (+319 nodes collapsed)
block_comment "/**\n * Convert returns to assignments and breaks, as need"...
method_declaration (+314 nodes collapsed)
block_comment "/***********************************************************"...
block_comment "/**\n * Example:\n * a = (void) 0;\n */"
method_declaration (+97 nodes collapsed)
block_comment "/**\n * Replace the 'return' statement with its child expre"...
method_declaration (+116 nodes collapsed)
block_comment "/**\n * Create a valid statement Node containing an assignm"...
method_declaration (+71 nodes collapsed)
block_comment "/**\n * Replace the 'return' statement with its child expre"...
method_declaration (+161 nodes collapsed)
block_comment "/**\n * @return Whether the given block end with an return "...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Replace the 'return' statement with its child expre"...
method_declaration (+282 nodes collapsed)
} "}"