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

Side by Side Diff: packages/dart_style/test/whitespace/metadata.unit

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 >>> force newline before directives
3 @deprecated library foo;
4
5 @deprecated import 'dart:io';
6
7 @deprecated export 'dart:io';
8 <<<
9 @deprecated
10 library foo;
11
12 @deprecated
13 import 'dart:io';
14
15 @deprecated
16 export 'dart:io';
17 >>> force newline before types
18 @meta class X {}
19
20 @meta class Y = X with Z;
21
22 @meta typedef void X(y);
23 <<<
24 @meta
25 class X {}
26
27 @meta
28 class Y = X with Z;
29
30 @meta
31 typedef void X(y);
32 >>> force newline before variable declarations
33 foo() {
34 @meta var a;
35
36 @meta
37 var b;
38
39 @a @b
40
41
42 var c;
43 }
44 <<<
45 foo() {
46 @meta
47 var a;
48
49 @meta
50 var b;
51
52 @a
53 @b
54 var c;
55 }
56 >>> allow inline annotations before functions
57 @meta foo() {}
58 <<<
59 @meta foo() {}
60 >>> allow newline before functions
61 @meta
62
63
64 foo() {}
65 <<<
66 @meta
67 foo() {}
68 >>> allow inline annotations before members
69 class X {
70 @meta var _x;
71 @meta X.y();
72 @meta factory X(x) => null;
73 @meta int x() => null;
74 }
75 <<<
76 class X {
77 @meta var _x;
78 @meta X.y();
79 @meta factory X(x) => null;
80 @meta int x() => null;
81 }
82 >>> allow newline before members
83 class X {
84 @meta
85
86 var _x;
87
88 @meta
89
90
91
92 X.y();
93
94 @meta
95 factory X(x) => null;
96
97 @meta
98
99 int x() => null;
100 }
101 <<<
102 class X {
103 @meta
104 var _x;
105
106 @meta
107 X.y();
108
109 @meta
110 factory X(x) => null;
111
112 @meta
113 int x() => null;
114 }
115 >>> collapse newlines between annotations
116 @a
117
118
119 @b
120
121
122
123 @c
124
125
126 class A {}
127 <<<
128 @a
129 @b
130 @c
131 class A {}
132 >>> multiple top-level annotations always get their own line
133 @a @b class A {}
134 <<<
135 @a
136 @b
137 class A {}
138 >>> multiple member annotations always get their own line
139 class A {
140 @a @b void foo() {}
141 }
142 <<<
143 class A {
144 @a
145 @b
146 void foo() {}
147 }
148 >>> parameter annotations are inline
149 foo(
150
151 @a
152
153 @b
154
155 param) {}
156 <<<
157 foo(@a @b param) {}
158 >>> type parameter annotations are inline
159 class Foo<
160
161 @a
162
163 @b
164
165 T> {}
166 <<<
167 class Foo<@a @b T> {}
168 >>> comment after metadata
169 @DomName('DatabaseCallback')
170 @Experimental() // deprecated
171 typedef void DatabaseCallback(database);
172 <<<
173 @DomName('DatabaseCallback')
174 @Experimental() // deprecated
175 typedef void DatabaseCallback(database);
176 >>> comment between metadata
177 @DomName('DatabaseCallback') // deprecated
178 @Experimental()
179 typedef void DatabaseCallback(database);
180 <<<
181 @DomName(
182 'DatabaseCallback') // deprecated
183 @Experimental()
184 typedef void DatabaseCallback(database);
185 >>> metadata on top-level variables
186 @DomName('DatabaseCallback')
187 @Experimental()
188 var variable;
189 <<<
190 @DomName('DatabaseCallback')
191 @Experimental()
192 var variable;
193 >>> metadata on parameters
194 main(@foo @bar param) {}
195 <<<
196 main(@foo @bar param) {}
197 >>> metadata on initializing formal
198 class Foo {
199 Foo(@bar this.field);
200 }
201 <<<
202 class Foo {
203 Foo(@bar this.field);
204 }
205 >>> metadata on function-typed formal parameter
206 withReturnType(@foo @bar int fn(@foo param)) {}
207 withoutReturnType(@foo @bar fn(@foo param)) {}
208 <<<
209 withReturnType(
210 @foo @bar int fn(@foo param)) {}
211 withoutReturnType(
212 @foo @bar fn(@foo param)) {}
213 >>> metadata on default formal parameter
214 positional([@foo bar]) {}
215 named({@foo bar}) {}
216 <<<
217 positional([@foo bar]) {}
218 named({@foo bar}) {}
OLDNEW
« no previous file with comments | « packages/dart_style/test/whitespace/if.stmt ('k') | packages/dart_style/test/whitespace/methods.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698