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

Side by Side Diff: packages/dart_style/test/splitting/mixed.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 unified diff | Download patch
OLDNEW
(Empty)
1 40 columns |
2 >>> keeps map on one line if possible
3 sendPort.send({'type': 'error', 'error': 'oops'});
4 <<<
5 sendPort.send(
6 {'type': 'error', 'error': 'oops'});
7 >>> prefers to wrap before "."
8 new Future.sync(() => callback('msg')).then(
9 (result) => replyTo.send()).catchError((error) {});
10 <<<
11 new Future.sync(() => callback('msg'))
12 .then((result) => replyTo.send())
13 .catchError((error) {});
14 >>>
15 Stream readInput(AssetId id) => future((input) => input.read());
16 <<<
17 Stream readInput(AssetId id) =>
18 future((input) => input.read());
19 >>> nested expression indentation
20 someFunctionName(argument, argument, argument,
21 someOtherFunction(argument, argument, arg));
22 <<<
23 someFunctionName(
24 argument,
25 argument,
26 argument,
27 someOtherFunction(
28 argument, argument, arg));
29 >>> does not extra indent when multiple levels of nesting happen on one line
30 someFunctionName(argument, argument, argument,
31 some(other(function(argument, argument, arg))));
32 <<<
33 someFunctionName(
34 argument,
35 argument,
36 argument,
37 some(other(function(
38 argument, argument, arg))));
39 >>> forces extra indent and lines, if later line needs it
40 callSomeMethod(innerFunction(argument, argument, argument), argument, argument, argument);
41 <<<
42 callSomeMethod(
43 innerFunction(
44 argument, argument, argument),
45 argument,
46 argument,
47 argument);
48 >>> function inside a collection
49 [item, obj.method(argument).method(argument).method(() {body;}).another().anothe r()];
50 <<<
51 [
52 item,
53 obj
54 .method(argument)
55 .method(argument)
56 .method(() {
57 body;
58 }).another().another()
59 ];
60 >>> function inside an argument list
61 function(argument, obj.method(argument).method(argument).method(() {body;}).anot her().another());
62 <<<
63 function(
64 argument,
65 obj
66 .method(argument)
67 .method(argument)
68 .method(() {
69 body;
70 }).another().another());
71 >>> unnested function inside nested expression
72 function(argument, function(() {;}));
73 <<<
74 function(argument, function(() {
75 ;
76 }));
77 >>> nested function inside nested expression
78 function(argument, function(() {;}, argument, () {;}));
79 <<<
80 function(
81 argument,
82 function(
83 () {
84 ;
85 },
86 argument,
87 () {
88 ;
89 }));
90 >>> wrap before =>
91 receiver.firstMethod().next((parameter) => longIdentifier == veryLongIdentifier) ;
92 <<<
93 receiver.firstMethod().next(
94 (parameter) => longIdentifier ==
95 veryLongIdentifier);
96 >>> wrap after =>
97 receiver.firstMethod().next(() => veryveryveryverylongIdentifier == veryLongIden tifier);
98 <<<
99 receiver.firstMethod().next(() =>
100 veryveryveryverylongIdentifier ==
101 veryLongIdentifier);
102 >>> wrap at nested binary operator
103 receiver.firstMethod().next(longIdentifier == veryLongIdentifier);
104 <<<
105 receiver.firstMethod().next(
106 longIdentifier ==
107 veryLongIdentifier);
108 >>> list inside method chain
109 receiver.first([listItem, secondItem, thirdItem]).second();
110 <<<
111 receiver.first([
112 listItem,
113 secondItem,
114 thirdItem
115 ]).second();
116 >>> list at end of method chain
117 receiver.first().second([listItem, secondItem, thirdItem, fourthItem]);
118 <<<
119 receiver.first().second([
120 listItem,
121 secondItem,
122 thirdItem,
123 fourthItem
124 ]);
125 >>> binary operators in ascending precedence
126 {
127 b___________________ || a______________ && a______________ == a______________ > a______________ + a______________;
128 }
129 <<<
130 {
131 b___________________ ||
132 a______________ &&
133 a______________ ==
134 a______________ >
135 a______________ +
136 a______________;
137 }
138 >>> binary operators in descending precedence
139 {
140 b___________________ + a______________ > a______________ == a______________ && a______________ || a______________;
141 }
142 <<<
143 {
144 b___________________ +
145 a______________ >
146 a______________ ==
147 a______________ &&
148 a______________ ||
149 a______________;
150 }
151 >>> mixed multiplicative operators
152 longName * longName / longName % longName ~/ longName;
153 <<<
154 longName *
155 longName /
156 longName %
157 longName ~/
158 longName;
159 >>> mixed additive operators
160 longName + longName - longName + longName - longName;
161 <<<
162 longName +
163 longName -
164 longName +
165 longName -
166 longName;
167 >>> mixed shift operators
168 longName >> longName << longName >> longName << longName;
169 <<<
170 longName >>
171 longName <<
172 longName >>
173 longName <<
174 longName;
175 >>> mixture of same and different precedence
176 veryLongIdentifier + veryLongIdentifier / veryLongIdentifier *
177 veryLongIdentifier - veryLongIdentifier * veryLongIdentifier +
178 veryLongIdentifier / veryLongIdentifier - veryLongIdentifier;
179 <<<
180 veryLongIdentifier +
181 veryLongIdentifier /
182 veryLongIdentifier *
183 veryLongIdentifier -
184 veryLongIdentifier *
185 veryLongIdentifier +
186 veryLongIdentifier /
187 veryLongIdentifier -
188 veryLongIdentifier;
189 >>> choose extra nesting if it leads to better solution
190 longIdentifier +
191 (longIdentifier ? 0 :
192 1) == identifier;
193 <<<
194 longIdentifier +
195 (longIdentifier ? 0 : 1) ==
196 identifier;
OLDNEW
« no previous file with comments | « packages/dart_style/test/splitting/members.unit ('k') | packages/dart_style/test/splitting/parameters.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698