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–778 unchanged (778 lines)
779 addExpr(current.getFirstChild().getNext(), rightPrecedence, rhsContext);
780 } while (current != n);
781 }
782
783 static boolean isSimpleNumber(String s) {
784 int len = s.length();
785 for (int index = 0; index < len; index++) {
786 char c = s.charAt(index);
787 if (c < '0' || c > '9') {
788 return false;
789 }
790 }
791 return len > 0 && s.charAt(0) != '0';
792 }
793
794 static double getSimpleNumber(String s) {
795 if (isSimpleNumber(s)) {
796 try {
797 long l = Long.parseLong(s);
…lines 798–1288 unchanged (491 lines)

After

…lines 1–778 unchanged (778 lines)
779 addExpr(current.getFirstChild().getNext(), rightPrecedence, rhsContext);
780 } while (current != n);
781 }
782
783 static boolean isSimpleNumber(String s) {
784 int len = s.length();
785 if (len == 0) {
786 return false;
787 }
788 for (int index = 0; index < len; index++) {
789 char c = s.charAt(index);
790 if (c < '0' || c > '9') {
791 return false;
792 }
793 }
794 return len == 1 || s.charAt(0) != '0';
795 }
796
797 static double getSimpleNumber(String s) {
798 if (isSimpleNumber(s)) {
799 try {
800 long l = Long.parseLong(s);
…lines 801–1291 unchanged (491 lines)

Before

program
block_comment "/*\n * Copyright 2004 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 "Charsets"
; ";"
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 "Maps"
; ";"
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
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "TokenStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "Charset"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "CharsetEncoder"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * CodeGenerator generates codes from a parse tree, send"...
class_declaration
class "class"
identifier "CodeGenerator"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "LT_ESCAPED"
= "="
string_literal
" "\""
escape_sequence "\\\\"
string_fragment "x3c"
" "\""
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "GT_ESCAPED"
= "="
string_literal
" "\""
escape_sequence "\\\\"
string_fragment "x3e"
" "\""
; ";"
line_comment "// A memoizer for formatting strings as JS strings."
field_declaration (+23 nodes collapsed)
field_declaration (+49 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "CodeConsumer"
variable_declarator
identifier "cc"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CharsetEncoder"
variable_declarator
identifier "outputCharsetEncoder"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "preferSingleQuotes"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "trustedStrings"
; ";"
constructor_declaration (+37 nodes collapsed)
method_declaration (+24 nodes collapsed)
constructor_declaration (+111 nodes collapsed)
block_comment "/**\n * Insert a ECMASCRIPT 5 strict annotation.\n */"
method_declaration (+22 nodes collapsed)
method_declaration (+22 nodes collapsed)
method_declaration (+29 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+5149 nodes collapsed)
block_comment "/**\n * We could use addList recursively here, but sometime"...
method_declaration (+165 nodes collapsed)
method_declaration
modifiers
static "static"
boolean_type "boolean"
identifier "isSimpleNumber"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "s"
) ")"
block
{ "{"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "len"
= "="
method_invocation
identifier "s"
. "."
identifier "length"
argument_list
( "("
) ")"
; ";"
for_statement (+60 nodes collapsed)
return_statement
return "return"
binary_expression
binary_expression
identifier "len"
> ">"
decimal_integer_literal "0"
&& "&&"
binary_expression
method_invocation
identifier "s"
. "."
identifier "charAt"
argument_list
( "("
decimal_integer_literal "0"
) ")"
!= "!="
character_literal "'0'"
; ";"
} "}"
method_declaration (+87 nodes collapsed)
block_comment "/**\n * @return Whether the name is an indirect eval.\n */"
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Adds a block or expression, substituting a VOID wit"...
method_declaration (+387 nodes collapsed)
block_comment "/**\n * @return Whether the Node is a DO or FUNCTION (with "...
method_declaration (+144 nodes collapsed)
method_declaration (+124 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+118 nodes collapsed)
block_comment "/**\n * This function adds a comma-separated list as is spe"...
method_declaration (+114 nodes collapsed)
method_declaration (+38 nodes collapsed)
method_declaration (+49 nodes collapsed)
block_comment "/** Outputs a JS string, using the optimal (single/double) q"...
method_declaration (+143 nodes collapsed)
method_declaration (+226 nodes collapsed)
block_comment "/** Escapes regular expression */"
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Escapes the given string to a double quoted (\") Jav"...
method_declaration (+46 nodes collapsed)
block_comment "/* If the user doesn't want to specify an output charset enc"...
method_declaration (+23 nodes collapsed)
block_comment "/** Helper to escape JavaScript string as well as regular ex"...
method_declaration (+954 nodes collapsed)
method_declaration (+147 nodes collapsed)
block_comment "/**\n * @param maxCount The maximum number of children to l"...
method_declaration (+129 nodes collapsed)
block_comment "/** Gets the first non-empty child of the given node. */"
method_declaration (+119 nodes collapsed)
line_comment "// Information on the current context. Used for disambiguati"...
line_comment "// For example, a \"{\" could indicate the start of an object "...
line_comment "// block, depending on the current context."
enum_declaration (+27 nodes collapsed)
method_declaration (+35 nodes collapsed)
block_comment "/**\n * If we're in a IN_FOR_INIT_CLAUSE, we can't permit i"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * @see #appendHexJavaScriptRepresentation(int, Append"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Returns a JavaScript representation of the characte"...
method_declaration (+181 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2004 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 "Charsets"
; ";"
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 "Maps"
; ";"
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
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "TokenStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "Charset"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "nio"
. "."
identifier "charset"
. "."
identifier "CharsetEncoder"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
block_comment "/**\n * CodeGenerator generates codes from a parse tree, send"...
class_declaration
class "class"
identifier "CodeGenerator"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "LT_ESCAPED"
= "="
string_literal
" "\""
escape_sequence "\\\\"
string_fragment "x3c"
" "\""
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "GT_ESCAPED"
= "="
string_literal
" "\""
escape_sequence "\\\\"
string_fragment "x3e"
" "\""
; ";"
line_comment "// A memoizer for formatting strings as JS strings."
field_declaration (+23 nodes collapsed)
field_declaration (+49 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "CodeConsumer"
variable_declarator
identifier "cc"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "CharsetEncoder"
variable_declarator
identifier "outputCharsetEncoder"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "preferSingleQuotes"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "trustedStrings"
; ";"
constructor_declaration (+37 nodes collapsed)
method_declaration (+24 nodes collapsed)
constructor_declaration (+111 nodes collapsed)
block_comment "/**\n * Insert a ECMASCRIPT 5 strict annotation.\n */"
method_declaration (+22 nodes collapsed)
method_declaration (+22 nodes collapsed)
method_declaration (+29 nodes collapsed)
method_declaration (+25 nodes collapsed)
method_declaration (+5149 nodes collapsed)
block_comment "/**\n * We could use addList recursively here, but sometime"...
method_declaration (+165 nodes collapsed)
method_declaration
modifiers
static "static"
boolean_type "boolean"
identifier "isSimpleNumber"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "s"
) ")"
block
{ "{"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "len"
= "="
method_invocation
identifier "s"
. "."
identifier "length"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "len"
== "=="
decimal_integer_literal "0"
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
for_statement (+60 nodes collapsed)
return_statement
return "return"
binary_expression
binary_expression
identifier "len"
== "=="
decimal_integer_literal "1"
|| "||"
binary_expression
method_invocation
identifier "s"
. "."
identifier "charAt"
argument_list
( "("
decimal_integer_literal "0"
) ")"
!= "!="
character_literal "'0'"
; ";"
} "}"
method_declaration (+87 nodes collapsed)
block_comment "/**\n * @return Whether the name is an indirect eval.\n */"
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Adds a block or expression, substituting a VOID wit"...
method_declaration (+387 nodes collapsed)
block_comment "/**\n * @return Whether the Node is a DO or FUNCTION (with "...
method_declaration (+144 nodes collapsed)
method_declaration (+124 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+118 nodes collapsed)
block_comment "/**\n * This function adds a comma-separated list as is spe"...
method_declaration (+114 nodes collapsed)
method_declaration (+38 nodes collapsed)
method_declaration (+49 nodes collapsed)
block_comment "/** Outputs a JS string, using the optimal (single/double) q"...
method_declaration (+143 nodes collapsed)
method_declaration (+226 nodes collapsed)
block_comment "/** Escapes regular expression */"
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Escapes the given string to a double quoted (\") Jav"...
method_declaration (+46 nodes collapsed)
block_comment "/* If the user doesn't want to specify an output charset enc"...
method_declaration (+23 nodes collapsed)
block_comment "/** Helper to escape JavaScript string as well as regular ex"...
method_declaration (+954 nodes collapsed)
method_declaration (+147 nodes collapsed)
block_comment "/**\n * @param maxCount The maximum number of children to l"...
method_declaration (+129 nodes collapsed)
block_comment "/** Gets the first non-empty child of the given node. */"
method_declaration (+119 nodes collapsed)
line_comment "// Information on the current context. Used for disambiguati"...
line_comment "// For example, a \"{\" could indicate the start of an object "...
line_comment "// block, depending on the current context."
enum_declaration (+27 nodes collapsed)
method_declaration (+35 nodes collapsed)
block_comment "/**\n * If we're in a IN_FOR_INIT_CLAUSE, we can't permit i"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * @see #appendHexJavaScriptRepresentation(int, Append"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Returns a JavaScript representation of the characte"...
method_declaration (+181 nodes collapsed)
} "}"