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

Side by Side Diff: test/splitting/function_arguments.stmt

Issue 1258203006: Handle function arguments inside function calls. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Reformat self. Created 5 years, 4 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
« no previous file with comments | « test/regression/0300/0366.stmt ('k') | test/splitting/mixed.stmt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 40 columns | 1 40 columns |
2 >>> args before and after function do not force nesting 2 >>> args before and after function do not force nesting
3 method(first,() {fn;},third); 3 method(first,() {fn;},third);
4 <<< 4 <<<
5 method(first, () { 5 method(first, () {
6 fn; 6 fn;
7 }, third); 7 }, third);
8 >>> nothing but function args does not nest 8 >>> nothing but function args does not nest
9 longFunctionName(() {;}, () {;}, () {;}); 9 longFunctionName(() {;}, () {;}, () {;});
10 <<< 10 <<<
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 >>> functions with named arguments 130 >>> functions with named arguments
131 longFunctionName(() {;}, a: () {;}, b: () {;}); 131 longFunctionName(() {;}, a: () {;}, b: () {;});
132 <<< 132 <<<
133 longFunctionName(() { 133 longFunctionName(() {
134 ; 134 ;
135 }, a: () { 135 }, a: () {
136 ; 136 ;
137 }, b: () { 137 }, b: () {
138 ; 138 ;
139 }); 139 });
140 >>> don't nest because of nested 1-arg fn 140 >>> do not nest because of nested 1-arg fn
141 outer(inner(() {body;})); 141 outer(inner(() {body;}));
142 <<< 142 <<<
143 outer(inner(() { 143 outer(inner(() {
144 body; 144 body;
145 })); 145 }));
146 >>> do nest because of nested many-arg fn 146 >>> do not nest because of nested many-arg fn
147 outer(argument, inner(() {body;})); 147 outer(argument, inner(() {body;}));
148 <<< 148 <<<
149 outer( 149 outer(argument, inner(() {
150 argument,
151 inner(() {
152 body;
153 }));
154 >>> don't nest because of nested 1-arg method call
155 obj.outer(obj.inner(() {body;}));
156 <<<
157 obj.outer(obj.inner(() {
158 body; 150 body;
159 })); 151 }));
160 >>> do nest because of nested many-arg method call 152 >>> do not nest because of nested 1-arg method call
161 obj.outer(argument, obj.inner(() {body;})); 153 obj.outer(a.b.c.fn(() {body;}));
162 <<< 154 <<<
163 obj.outer( 155 obj.outer(a.b.c.fn(() {
164 argument, 156 body;
165 obj.inner(() { 157 }));
166 body; 158 >>> do not nest because of nested many-arg method call
167 })); 159 obj.outer(argument, a.b.c.fn(() {body;}));
160 <<<
161 obj.outer(argument, a.b.c.fn(() {
162 body;
163 }));
168 >>> do not force named args to split on positional function 164 >>> do not force named args to split on positional function
169 function(argument, () {;}, 165 function(argument, () {;},
170 named: argument, another: argument); 166 named: argument, another: argument);
171 <<< 167 <<<
172 function(argument, () { 168 function(argument, () {
173 ; 169 ;
174 }, named: argument, another: argument); 170 }, named: argument, another: argument);
175 >>> args before and after functions split independently 171 >>> args before and after functions split independently
176 longFunction(argument, argument, argument, argument, argument, 172 longFunction(argument, argument, argument, argument, argument,
177 () {;}, () {;}, argument, argument, argument, argument, argument); 173 () {;}, () {;}, argument, argument, argument, argument, argument);
178 <<< 174 <<<
179 longFunction(argument, argument, 175 longFunction(argument, argument,
180 argument, argument, argument, () { 176 argument, argument, argument, () {
181 ; 177 ;
182 }, () { 178 }, () {
183 ; 179 ;
184 }, argument, argument, argument, 180 }, argument, argument, argument,
185 argument, argument); 181 argument, argument);
OLDNEW
« no previous file with comments | « test/regression/0300/0366.stmt ('k') | test/splitting/mixed.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698