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

Unified Diff: packages/dart_style/test/whitespace/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
« no previous file with comments | « packages/dart_style/test/whitespace/enums.unit ('k') | packages/dart_style/test/whitespace/for.stmt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/dart_style/test/whitespace/expressions.stmt
diff --git a/packages/dart_style/test/whitespace/expressions.stmt b/packages/dart_style/test/whitespace/expressions.stmt
new file mode 100644
index 0000000000000000000000000000000000000000..ef31265bfa4b8b71095dd3a19662086244bc4f2e
--- /dev/null
+++ b/packages/dart_style/test/whitespace/expressions.stmt
@@ -0,0 +1,117 @@
+40 columns |
+>>> arithmetic operators
+var a=1+2/(3*-b~/4);
+<<<
+var a = 1 + 2 / (3 * -b ~/ 4);
+>>> conditional operator
+var c=!condition==a>b;
+<<<
+var c = !condition == a > b;
+>>>
+var d=condition?b:obj.foo(a, b);
+<<<
+var d = condition ? b : obj.foo(a, b);
+>>> as
+identifier as TypeName;
+<<<
+identifier as TypeName;
+>>> is
+identifier is TypeName;
+<<<
+identifier is TypeName;
+>>> is!
+var d=obj is!SomeType;
+<<<
+var d = obj is! SomeType;
+>>> generic list literal
+< int >[1,2,(3+4)];
+<<<
+<int>[1, 2, (3 + 4)];
+>>>
+x &&
+ y;
+<<<
+x && y;
+>>> empty map literal (dartbug.com/16382)
+var m = { };
+<<<
+var m = {};
+>>>
+var m = {};
+<<<
+var m = {};
+>>> generic map literal
+< int,int >{ };
+<<<
+<int, int>{};
+>>> unqualified symbol
+var x = #foo;
+<<<
+var x = #foo;
+>>> qualified symbol
+var y=#foo.bar.baz;
+<<<
+var y = #foo.bar.baz;
+>>> long string literal
+throw new FormatException("This is a long exception message.");
+<<<
+throw new FormatException(
+ "This is a long exception message.");
+>>>
+assert(false);
+<<<
+assert(false);
+>>> DON'T indent lines that are continued with a function expression.
+new Future(new Duration(1), () {
+ print('I am a callback');
+ });
+<<<
+new Future(new Duration(1), () {
+ print('I am a callback');
+});
+>>> DO use a space after : in named arguments.
+new ListBox(showScrollbars :true);
+<<<
+new ListBox(showScrollbars: true);
+>>> multiple prefix operators
+- ~ ! foo;
+<<<
+-~!foo;
+>>> sequential "-" operators are not joined
+- - - -foo;
+<<<
+- - - -foo;
+>>> a "-" operator before a negative integer is not joined
+- -1;
+<<<
+- -1;
+>>> a "-" operator before a negative floating point number is not joined
+- -1.2;
+<<<
+- -1.2;
+>>> multiline string inside nested blocks
+main() {
+ inner() {
+ function("""
+string""");
+ }
+}
+<<<
+main() {
+ inner() {
+ function("""
+string""");
+ }
+}
+>>> null coalescing operator
+argument?? argument;
+<<<
+argument ?? argument;
+>>> ?. operator
+receiver ?. method() ?. getter;
+<<<
+receiver?.method()?.getter;
+>>> null coalescing self assignment
+variableName??=argument;
+<<<
+variableName ??= argument;
« no previous file with comments | « packages/dart_style/test/whitespace/enums.unit ('k') | packages/dart_style/test/whitespace/for.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698