Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: packages/dart_style/test/splitting/expressions.stmt

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: packages/dart_style/test/splitting/expressions.stmt
diff --git a/packages/dart_style/test/splitting/expressions.stmt b/packages/dart_style/test/splitting/expressions.stmt
new file mode 100644
index 0000000000000000000000000000000000000000..8ac19efd6d6893ee612408a0916b6a7edff91a98
--- /dev/null
+++ b/packages/dart_style/test/splitting/expressions.stmt
@@ -0,0 +1,136 @@
+40 columns |
+>>> space-separated adjacent strings are not split if they fit
+var name = new Symbol("the first string" "the second");
+<<<
+var name = new Symbol(
+ "the first string" "the second");
+>>> space-separated adjacent strings are split if they don't fit
+var name = new Symbol("the first very long string" "the second very longstring");
+<<<
+var name = new Symbol(
+ "the first very long string"
+ "the second very longstring");
+>>> adjacent string lines all split together;
+var text = "first" "second" "third" "fourth" "fifth";
+<<<
+var text = "first"
+ "second"
+ "third"
+ "fourth"
+ "fifth";
+>>> preserve one newline between adjacent strings
+var name = "the first string"
+"the second string"
+
+
+
+"the third string";
+<<<
+var name = "the first string"
+ "the second string"
+ "the third string";
+>>> conditions, same operator
+if (identifier || identifier || identifier || identifier) {
+}
+<<<
+if (identifier ||
+ identifier ||
+ identifier ||
+ identifier) {}
+>>> conditions, different operators
+if (identifier && identifier || identifier
+ && identifier) {
+}
+<<<
+if (identifier && identifier ||
+ identifier && identifier) {}
+>>> split conditional because then doesn't fit
+var kind = element != null ? longArgument : arg;
+<<<
+var kind = element != null
+ ? longArgument
+ : arg;
+>>> split conditional because else doesn't fit
+var kind = element != null ? argument : secondArgumentThatIsReallyLong;
+<<<
+var kind = element != null
+ ? argument
+ : secondArgumentThatIsReallyLong;
+>>> split operator chain around block
+first + second + () {body;} + third + fourth;
+<<<
+first +
+ second +
+ () {
+ body;
+ } +
+ third +
+ fourth;
+>>> indent previous line farther because later line is nested deeper
+someFunction(someExtremelyLongArgumentName).clamp();
+<<<
+someFunction(
+ someExtremelyLongArgumentName)
+ .clamp();
+>>> wrap inside parenthesized
+(someVerylongIdentifier * someVerylongIdentifier);
+<<<
+(someVerylongIdentifier *
+ someVerylongIdentifier);
+>>> same operator inside parenthesized is treated independently
+(identifier * (identifier * identifier) * identifier);
+<<<
+(identifier *
+ (identifier * identifier) *
+ identifier);
+>>> nested parenthesized are indented more
+(identifier * (verylongIdentifier * verylongIdentifier) * identifier);
+<<<
+(identifier *
+ (verylongIdentifier *
+ verylongIdentifier) *
+ identifier);
+>>> conditional operands are nested
+identifier ? identifier ? someParticularlyLongOperand : someParticularlyLongOperand : identifier ? someParticularlyLongOperand : someParticularlyLongOperand;
+<<<
+identifier
+ ? identifier
+ ? someParticularlyLongOperand
+ : someParticularlyLongOperand
+ : identifier
+ ? someParticularlyLongOperand
+ : someParticularlyLongOperand;
+>>> index expressions can split after "["
+verylongIdentifier[someParticularlyLongArgument];
+<<<
+verylongIdentifier[
+ someParticularlyLongArgument];
+>>> index arguments nest
+verylongIdentifier[someParticularlyLongArgument[someParticularlyLongArgument]];
+<<<
+verylongIdentifier[
+ someParticularlyLongArgument[
+ someParticularlyLongArgument]];
+>>> successive index arguments
+identifier[longArgument][longArgument][longArgument][longArgument][longArgument];
+<<<
+identifier[longArgument][longArgument]
+ [longArgument][longArgument]
+ [longArgument];
+>>> is
+verylongIdentifier.property is LongTypeName;
+<<<
+verylongIdentifier.property
+ is LongTypeName;
+>>> as
+verylongIdentifier.property as LongTypeName;
+<<<
+verylongIdentifier.property
+ as LongTypeName;
+>>> null coalescing operator
+identifier&&identifier&&identifier&&identifier;
+<<<
+identifier &&
+ identifier &&
+ identifier &&
+ identifier;
« no previous file with comments | « packages/dart_style/test/splitting/exports.unit ('k') | packages/dart_style/test/splitting/function_arguments.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698