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

1fun registerUser(email: String, password: String): Boolean {
2 println("Registering user with email: $email")
3 return true
4}
5
6fun main() {
7 registerUser("test@example.com", "password123")
8}
9

After

1fun registerUser(email: String, password: String): Boolean {
2 if (!email.contains("@")) {
3 throw IllegalArgumentException("Invalid email format")
4 }
5 if (password.length < 8) {
6 throw IllegalArgumentException("Password must be at least 8 characters")
7 }
8 println("Registering user with email: $email")
9 return true
10}
11
12fun main() {
13 registerUser("test@example.com", "password123")
14}
15

Before

source_file
function_declaration
fun "fun"
identifier "registerUser"
function_value_parameters
( "("
parameter
identifier "email"
: ":"
user_type
identifier "String"
, ","
parameter
identifier "password"
: ":"
user_type
identifier "String"
) ")"
: ":"
user_type
identifier "Boolean"
function_body
block
{ "{"
call_expression
identifier "println"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "Registering user with email: "
string_content "$"
string_content "email"
" "\""
) ")"
return_expression
return "return"
identifier "true"
} "}"
function_declaration (+26 nodes collapsed)

After

source_file
function_declaration
fun "fun"
identifier "registerUser"
function_value_parameters
( "("
parameter
identifier "email"
: ":"
user_type
identifier "String"
, ","
parameter
identifier "password"
: ":"
user_type
identifier "String"
) ")"
: ":"
user_type
identifier "Boolean"
function_body
block
{ "{"
if_expression
if "if"
( "("
call_expression
navigation_expression
unary_expression
! "!"
identifier "email"
. "."
identifier "contains"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "@"
" "\""
) ")"
) ")"
block
{ "{"
throw_expression
throw "throw"
call_expression
identifier "IllegalArgumentException"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "Invalid email format"
" "\""
) ")"
} "}"
if_expression
if "if"
( "("
binary_expression
navigation_expression
identifier "password"
. "."
identifier "length"
< "<"
number_literal "8"
) ")"
block
{ "{"
throw_expression
throw "throw"
call_expression
identifier "IllegalArgumentException"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "Password must be at least 8 characters"
" "\""
) ")"
} "}"
call_expression
identifier "println"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "Registering user with email: "
string_content "$"
string_content "email"
" "\""
) ")"
return_expression
return "return"
identifier "true"
} "}"
function_declaration (+26 nodes collapsed)