A small but very complex case of declaration+initialization moving into separate declare + init. It also breaks the ";" must match first non-whitespace character invariant at this time. The first case in over a thousand fixtures...

This mapping is unfinished: 1 of 6549 nodes are still unmarked.

This mapping has 10 all-to-all groups: every node on one side corresponds to every node on the other, and none is deleted or inserted. Each member carries an all N:M badge; selecting one highlights all of its counterparts, in the tree and in the code view alike.

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–116 unchanged (116 lines)
117 /**
118 * For each node, update the block stack and reference collection
119 * as appropriate.
120 */
121 public void visit(NodeTraversal t, Node n, Node parent) {
122 if (n.getType() == Token.NAME) {
123 Var v = t.getScope().getVar(n.getString());
124 if (v != null && varFilter.apply(v)) {
125 addReference(t, v,
126 new Reference(n, parent, t, blockStack.peek()));
127 }
128 }
129
…lines 130–614 unchanged (485 lines)

After

…lines 1–116 unchanged (116 lines)
117 /**
118 * For each node, update the block stack and reference collection
119 * as appropriate.
120 */
121 public void visit(NodeTraversal t, Node n, Node parent) {
122 if (n.getType() == Token.NAME) {
123 Var v;
124 if (n.getString().equals("arguments")) {
125 v = t.getScope().getArgumentsVar();
126 } else {
127 v = t.getScope().getVar(n.getString());
128 }
129 if (v != null && varFilter.apply(v)) {
130 addReference(t, v,
131 new Reference(n, parent, t, blockStack.peek()));
132 }
133 }
134
…lines 135–619 unchanged (485 lines)

Before

program
block_comment "/*\n * Copyright 2008 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 "Predicate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Predicates"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
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 "ScopedCallback"
; ";"
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 "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 "ArrayDeque"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Deque"
; ";"
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"
; ";"
block_comment "/**\n * A helper class for passes that want to access all inf"...
class_declaration
class "class"
identifier "ReferenceCollectingCallback"
super_interfaces
implements "implements"
type_list
type_identifier "ScopedCallback"
, ","
type_identifier "CompilerPass"
class_body
{ "{"
block_comment "/**\n * Maps a given variable to a collection of references"...
field_declaration (+23 nodes collapsed)
block_comment "/**\n * The stack of basic blocks and scopes the current tr"...
field_declaration (+25 nodes collapsed)
block_comment "/**\n * Source of behavior at various points in the travers"...
field_declaration
modifiers
private "private"
final "final"
type_identifier "Behavior"
variable_declarator
identifier "behavior"
; ";"
block_comment "/**\n * Javascript compiler to use in traversing.\n */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
block_comment "/**\n * Only collect references for filtered variables.\n "...
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Predicate"
type_arguments
< "<"
type_identifier "Var"
> ">"
variable_declarator
identifier "varFilter"
; ";"
block_comment "/**\n * Constructor initializes block stack.\n */"
constructor_declaration (+36 nodes collapsed)
block_comment "/**\n * Constructor only collects references that match the"...
constructor_declaration (+51 nodes collapsed)
block_comment "/**\n * Convenience method for running this pass over a tre"...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * Gets the variables that were referenced in this cal"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Gets the reference collection for the given variabl"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * For each node, update the block stack and reference"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "visit"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "n"
. "."
identifier "getType"
argument_list
( "("
) ")"
== "=="
field_access
identifier "Token"
. "."
identifier "NAME"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Var"
variable_declarator
identifier "v" all 1:3
= "=" all 1:2
method_invocation
method_invocation all 1:2
identifier "t" all 1:2
. "." all 1:2
identifier "getScope" all 1:2
argument_list all 1:2
( "(" all 1:2
) ")" all 1:2
. "."
identifier "getVar"
argument_list
( "("
method_invocation
identifier "n"
. "."
identifier "getString"
argument_list
( "("
) ")"
) ")"
; ";" all 1:2
if_statement (+52 nodes collapsed)
} "}"
if_statement (+25 nodes collapsed)
} "}"
block_comment "/**\n * Updates block stack and invokes any additional beha"...
method_declaration (+75 nodes collapsed)
block_comment "/**\n * Updates block statck and invokes any additional beh"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Updates block stack.\n */"
method_declaration (+67 nodes collapsed)
block_comment "/**\n * @return true if this node marks the start of a new "...
method_declaration (+162 nodes collapsed)
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Way for callers to add specific behavior during tra"...
interface_declaration (+28 nodes collapsed)
field_declaration (+45 nodes collapsed)
block_comment "/**\n * A collection of references. Can be subclassed to ap"...
class_declaration (+1015 nodes collapsed)
block_comment "/**\n * Represents a single declaration or reference to a v"...
class_declaration (+799 nodes collapsed)
block_comment "/**\n * Represents a section of code that is uninterrupted "...
class_declaration (+280 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2008 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 "Predicate"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Predicates"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
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 "ScopedCallback"
; ";"
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 "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 "ArrayDeque"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Deque"
; ";"
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"
; ";"
block_comment "/**\n * A helper class for passes that want to access all inf"...
class_declaration
class "class"
identifier "ReferenceCollectingCallback"
super_interfaces
implements "implements"
type_list
type_identifier "ScopedCallback"
, ","
type_identifier "CompilerPass"
class_body
{ "{"
block_comment "/**\n * Maps a given variable to a collection of references"...
field_declaration (+23 nodes collapsed)
block_comment "/**\n * The stack of basic blocks and scopes the current tr"...
field_declaration (+25 nodes collapsed)
block_comment "/**\n * Source of behavior at various points in the travers"...
field_declaration
modifiers
private "private"
final "final"
type_identifier "Behavior"
variable_declarator
identifier "behavior"
; ";"
block_comment "/**\n * Javascript compiler to use in traversing.\n */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
block_comment "/**\n * Only collect references for filtered variables.\n "...
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Predicate"
type_arguments
< "<"
type_identifier "Var"
> ">"
variable_declarator
identifier "varFilter"
; ";"
block_comment "/**\n * Constructor initializes block stack.\n */"
constructor_declaration (+36 nodes collapsed)
block_comment "/**\n * Constructor only collects references that match the"...
constructor_declaration (+51 nodes collapsed)
block_comment "/**\n * Convenience method for running this pass over a tre"...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * Gets the variables that were referenced in this cal"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Gets the reference collection for the given variabl"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * For each node, update the block stack and reference"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "visit"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "n"
. "."
identifier "getType"
argument_list
( "("
) ")"
== "=="
field_access
identifier "Token"
. "."
identifier "NAME"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Var"
variable_declarator
identifier "v" all 1:3
; ";"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
method_invocation
identifier "n"
. "."
identifier "getString"
argument_list
( "("
) ")"
. "."
identifier "equals"
argument_list
( "("
string_literal
" "\""
string_fragment "arguments"
" "\""
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "v" all 1:3
= "=" all 1:2
method_invocation
method_invocation all 1:2
identifier "t" all 1:2
. "." all 1:2
identifier "getScope" all 1:2
argument_list all 1:2
( "(" all 1:2
) ")" all 1:2
. "."
identifier "getArgumentsVar"
argument_list
( "("
) ")"
; ";" all 1:2
} "}"
else "else"
block
{ "{"
expression_statement
assignment_expression
identifier "v" all 1:3
= "=" all 1:2
method_invocation
method_invocation all 1:2
identifier "t" all 1:2
. "." all 1:2
identifier "getScope" all 1:2
argument_list all 1:2
( "(" all 1:2
) ")" all 1:2
. "."
identifier "getVar"
argument_list
( "("
method_invocation
identifier "n"
. "."
identifier "getString"
argument_list
( "("
) ")"
) ")"
; ";" all 1:2
} "}"
if_statement (+52 nodes collapsed)
} "}"
if_statement (+25 nodes collapsed)
} "}"
block_comment "/**\n * Updates block stack and invokes any additional beha"...
method_declaration (+75 nodes collapsed)
block_comment "/**\n * Updates block statck and invokes any additional beh"...
method_declaration (+35 nodes collapsed)
block_comment "/**\n * Updates block stack.\n */"
method_declaration (+67 nodes collapsed)
block_comment "/**\n * @return true if this node marks the start of a new "...
method_declaration (+162 nodes collapsed)
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Way for callers to add specific behavior during tra"...
interface_declaration (+28 nodes collapsed)
field_declaration (+45 nodes collapsed)
block_comment "/**\n * A collection of references. Can be subclassed to ap"...
class_declaration (+1015 nodes collapsed)
block_comment "/**\n * Represents a single declaration or reference to a v"...
class_declaration (+799 nodes collapsed)
block_comment "/**\n * Represents a section of code that is uninterrupted "...
class_declaration (+280 nodes collapsed)
} "}"