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

Side by Side Diff: tools/idl_parser/test_parser/interface_web.idl

Issue 2708173002: idl_parser: Add support for the record<K, V> WebIDL type. (Closed)
Patch Set: Created 3 years, 10 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
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 Use of this source code is governed by a BSD-style license that can be 2 Use of this source code is governed by a BSD-style license that can be
3 found in the LICENSE file. */ 3 found in the LICENSE file. */
4 4
5 /* Test Interface productions 5 /* Test Interface productions
6 6
7 Run with --test to generate an AST and verify that all comments accurately 7 Run with --test to generate an AST and verify that all comments accurately
8 reflect the state of the Nodes. 8 reflect the state of the Nodes.
9 9
10 BUILD Type(Name) 10 BUILD Type(Name)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 /* ERROR Unexpected ":" after identifier "MyIFaceInherit". */ 49 /* ERROR Unexpected ":" after identifier "MyIFaceInherit". */
50 partial interface MyIFaceInherit : Foo {}; 50 partial interface MyIFaceInherit : Foo {};
51 51
52 /* TREE 52 /* TREE
53 *Interface(MyIFaceMissingArgument) 53 *Interface(MyIFaceMissingArgument)
54 * Operation(foo) 54 * Operation(foo)
55 * Arguments() 55 * Arguments()
56 * Argument(arg) 56 * Argument(arg)
57 * Type() 57 * Type()
58 * PrimitiveType(DOMString) 58 * StringType(DOMString)
59 * Error(Missing argument.) 59 * Error(Missing argument.)
60 * Type() 60 * Type()
61 * PrimitiveType(void) 61 * PrimitiveType(void)
62 */ 62 */
63 interface MyIFaceMissingArgument { 63 interface MyIFaceMissingArgument {
64 void foo(DOMString arg, ); 64 void foo(DOMString arg, );
65 }; 65 };
66 66
67 /* TREE 67 /* TREE
68 *Error(Unexpected keyword "double" after keyword "readonly".) 68 *Error(Unexpected keyword "double" after keyword "readonly".)
69 */ 69 */
70 interface MyIFaceMissingAttribute { 70 interface MyIFaceMissingAttribute {
71 readonly double foo; 71 readonly double foo;
72 }; 72 };
73 73
74 /* TREE 74 /* TREE
75 *Interface(MyIFaceContainsUnresolvedConflictDiff) 75 *Interface(MyIFaceContainsUnresolvedConflictDiff)
76 * Operation(foo) 76 * Operation(foo)
77 * Arguments() 77 * Arguments()
78 * Type() 78 * Type()
79 * PrimitiveType(DOMString) 79 * StringType(DOMString)
80 * Error(Unexpected "<" after ";".) 80 * Error(Unexpected "<" after ";".)
81 */ 81 */
82 interface MyIFaceContainsUnresolvedConflictDiff { 82 interface MyIFaceContainsUnresolvedConflictDiff {
83 DOMString foo(); 83 DOMString foo();
84 <<<<<< ours 84 <<<<<< ours
85 DOMString bar(); 85 DOMString bar();
86 iterable<long>; 86 iterable<long>;
87 ====== 87 ======
88 >>>>>> theirs 88 >>>>>> theirs
89 }; 89 };
90 90
91 /* TREE 91 /* TREE
92 *Interface(MyIFaceWrongRecordKeyType)
93 * Operation(foo)
94 * Arguments()
95 * Argument(arg)
96 * Type()
97 * Error(Unexpected identifier "int" after "<".)
98 * Type()
99 * PrimitiveType(void)
100 */
101 interface MyIFaceWrongRecordKeyType {
102 void foo(record<int, ByteString> arg);
103 };
104
105 /* TREE
92 *Interface(MyIFaceBig) 106 *Interface(MyIFaceBig)
93 * Const(setString) 107 * Const(setString)
94 * PrimitiveType(DOMString) 108 * StringType(DOMString)
95 * Value(NULL) 109 * Value(NULL)
96 */ 110 */
97 interface MyIFaceBig { 111 interface MyIFaceBig {
98 const DOMString? setString = null; 112 const DOMString? setString = null;
99 }; 113 };
100 114
101 /* TREE 115 /* TREE
102 *Interface(MyIfaceEmptySequenceDefalutValue) 116 *Interface(MyIfaceEmptySequenceDefalutValue)
103 * Operation(foo) 117 * Operation(foo)
104 * Arguments() 118 * Arguments()
105 * Argument(arg) 119 * Argument(arg)
106 * Type() 120 * Type()
107 * Sequence() 121 * Sequence()
108 * Type() 122 * Type()
109 * PrimitiveType(DOMString) 123 * StringType(DOMString)
110 * Default() 124 * Default()
111 * Type() 125 * Type()
112 * PrimitiveType(void) 126 * PrimitiveType(void)
113 */ 127 */
114 interface MyIfaceEmptySequenceDefalutValue { 128 interface MyIfaceEmptySequenceDefalutValue {
115 void foo(optional sequence<DOMString> arg = []); 129 void foo(optional sequence<DOMString> arg = []);
116 }; 130 };
117 131
118 /* TREE 132 /* TREE
133 *Interface(MyIfaceWithRecords)
134 * Operation(foo)
135 * Arguments()
136 * Argument(arg)
137 * Type()
138 * Record()
139 * StringType(DOMString)
140 * Type()
141 * PrimitiveType(long)
142 * Type()
143 * PrimitiveType(void)
144 * Operation(bar)
145 * Arguments()
146 * Argument(arg1)
147 * Type()
148 * Typeref(int)
149 * Argument(arg2)
150 * Type()
151 * Record()
152 * StringType(ByteString)
153 * Type()
154 * PrimitiveType(float)
155 * Type()
156 * PrimitiveType(double)
157 */
158 interface MyIfaceWithRecords {
159 void foo(record<DOMString, long> arg);
160 double bar(int arg1, record<ByteString, float> arg2);
161 };
162
163 /* TREE
119 *Interface(MyIFaceBig2) 164 *Interface(MyIFaceBig2)
120 * Const(nullValue) 165 * Const(nullValue)
121 * PrimitiveType(DOMString) 166 * StringType(DOMString)
122 * Value(NULL) 167 * Value(NULL)
123 * Const(longValue) 168 * Const(longValue)
124 * PrimitiveType(long) 169 * PrimitiveType(long)
125 * Value(123) 170 * Value(123)
126 * Const(longValue2) 171 * Const(longValue2)
127 * PrimitiveType(long long) 172 * PrimitiveType(long long)
128 * Value(123) 173 * Value(123)
129 * Attribute(myString) 174 * Attribute(myString)
130 * Type() 175 * Type()
131 * PrimitiveType(DOMString) 176 * StringType(DOMString)
132 * Attribute(readOnlyString) 177 * Attribute(readOnlyString)
133 * Type() 178 * Type()
134 * PrimitiveType(DOMString) 179 * StringType(DOMString)
135 * Attribute(staticString) 180 * Attribute(staticString)
136 * Type() 181 * Type()
137 * PrimitiveType(DOMString) 182 * StringType(DOMString)
138 * Operation(myFunction) 183 * Operation(myFunction)
139 * Arguments() 184 * Arguments()
140 * Argument(myLong) 185 * Argument(myLong)
141 * Type() 186 * Type()
142 * PrimitiveType(long long) 187 * PrimitiveType(long long)
143 * Type() 188 * Type()
144 * PrimitiveType(void) 189 * PrimitiveType(void)
145 * Operation(staticFunction) 190 * Operation(staticFunction)
146 * Arguments() 191 * Arguments()
147 * Argument(myLong) 192 * Argument(myLong)
(...skipping 13 matching lines...) Expand all
161 static void staticFunction(long long myLong); 206 static void staticFunction(long long myLong);
162 }; 207 };
163 208
164 209
165 /* TREE 210 /* TREE
166 *Interface(MyIFaceSpecials) 211 *Interface(MyIFaceSpecials)
167 * Operation(set) 212 * Operation(set)
168 * Arguments() 213 * Arguments()
169 * Argument(property) 214 * Argument(property)
170 * Type() 215 * Type()
171 * PrimitiveType(DOMString) 216 * StringType(DOMString)
172 * Type() 217 * Type()
173 * PrimitiveType(void) 218 * PrimitiveType(void)
174 * Operation(_unnamed_) 219 * Operation(_unnamed_)
175 * Arguments() 220 * Arguments()
176 * Argument(property) 221 * Argument(property)
177 * Type() 222 * Type()
178 * PrimitiveType(DOMString) 223 * StringType(DOMString)
179 * Type() 224 * Type()
180 * PrimitiveType(double) 225 * PrimitiveType(double)
181 * Operation(GetFiveSix) 226 * Operation(GetFiveSix)
182 * Arguments() 227 * Arguments()
183 * Argument(arg) 228 * Argument(arg)
184 * Type() 229 * Type()
185 * Typeref(SomeType) 230 * Typeref(SomeType)
186 * Type() 231 * Type()
187 * PrimitiveType(long long) 232 * PrimitiveType(long long)
188 * Array(5) 233 * Array(5)
189 * Array(6) 234 * Array(6)
190 */ 235 */
191 interface MyIFaceSpecials { 236 interface MyIFaceSpecials {
192 setter creator void set(DOMString property); 237 setter creator void set(DOMString property);
193 getter double (DOMString property); 238 getter double (DOMString property);
194 long long [5][6] GetFiveSix(SomeType arg); 239 long long [5][6] GetFiveSix(SomeType arg);
195 }; 240 };
196 241
197 /* TREE 242 /* TREE
198 *Interface(MyIFaceStringifiers) 243 *Interface(MyIFaceStringifiers)
199 * Stringifier() 244 * Stringifier()
200 * Stringifier() 245 * Stringifier()
201 * Operation(_unnamed_) 246 * Operation(_unnamed_)
202 * Arguments() 247 * Arguments()
203 * Type() 248 * Type()
204 * PrimitiveType(DOMString) 249 * StringType(DOMString)
205 * Stringifier() 250 * Stringifier()
206 * Operation(namedStringifier) 251 * Operation(namedStringifier)
207 * Arguments() 252 * Arguments()
208 * Type() 253 * Type()
209 * PrimitiveType(DOMString) 254 * StringType(DOMString)
210 * Stringifier() 255 * Stringifier()
211 * Attribute(stringValue) 256 * Attribute(stringValue)
212 * Type() 257 * Type()
213 * PrimitiveType(DOMString) 258 * StringType(DOMString)
214 */ 259 */
215 interface MyIFaceStringifiers { 260 interface MyIFaceStringifiers {
216 stringifier; 261 stringifier;
217 stringifier DOMString (); 262 stringifier DOMString ();
218 stringifier DOMString namedStringifier(); 263 stringifier DOMString namedStringifier();
219 stringifier attribute DOMString stringValue; 264 stringifier attribute DOMString stringValue;
220 }; 265 };
221 266
222 /* TREE 267 /* TREE
223 *Interface(MyExtendedAttributeInterface) 268 *Interface(MyExtendedAttributeInterface)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 319
275 /* TREE 320 /* TREE
276 *Interface(MyIfaceIterable) 321 *Interface(MyIfaceIterable)
277 * Iterable() 322 * Iterable()
278 * Type() 323 * Type()
279 * PrimitiveType(long) 324 * PrimitiveType(long)
280 * Iterable() 325 * Iterable()
281 * Type() 326 * Type()
282 * PrimitiveType(double) 327 * PrimitiveType(double)
283 * Type() 328 * Type()
284 * PrimitiveType(DOMString) 329 * StringType(DOMString)
285 * LegacyIterable() 330 * LegacyIterable()
286 * Type() 331 * Type()
287 * PrimitiveType(boolean) 332 * PrimitiveType(boolean)
288 */ 333 */
289 interface MyIfaceIterable { 334 interface MyIfaceIterable {
290 iterable<long>; 335 iterable<long>;
291 iterable<double, DOMString>; 336 iterable<double, DOMString>;
292 legacyiterable<boolean>; 337 legacyiterable<boolean>;
293 }; 338 };
294 339
295 /* TREE 340 /* TREE
296 *Interface(MyIfaceMaplike) 341 *Interface(MyIfaceMaplike)
297 * Maplike() 342 * Maplike()
298 * Type() 343 * Type()
299 * PrimitiveType(long) 344 * PrimitiveType(long)
300 * Type() 345 * Type()
301 * PrimitiveType(DOMString) 346 * StringType(DOMString)
302 * Maplike() 347 * Maplike()
303 * Type() 348 * Type()
304 * PrimitiveType(double) 349 * PrimitiveType(double)
305 * Type() 350 * Type()
306 * PrimitiveType(boolean) 351 * PrimitiveType(boolean)
307 */ 352 */
308 interface MyIfaceMaplike { 353 interface MyIfaceMaplike {
309 readonly maplike<long, DOMString>; 354 readonly maplike<long, DOMString>;
310 maplike<double, boolean>; 355 maplike<double, boolean>;
311 }; 356 };
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 serializer = [getter]; 414 serializer = [getter];
370 serializer = [name1, name2]; 415 serializer = [name1, name2];
371 }; 416 };
372 417
373 /* TREE 418 /* TREE
374 *Interface(MyIfaceFrozenArray) 419 *Interface(MyIfaceFrozenArray)
375 * Attribute(foo) 420 * Attribute(foo)
376 * Type() 421 * Type()
377 * FrozenArray() 422 * FrozenArray()
378 * Type() 423 * Type()
379 * PrimitiveType(DOMString) 424 * StringType(DOMString)
380 */ 425 */
381 interface MyIfaceFrozenArray { 426 interface MyIfaceFrozenArray {
382 readonly attribute FrozenArray<DOMString> foo; 427 readonly attribute FrozenArray<DOMString> foo;
383 }; 428 };
384 429
385 /* TREE 430 /* TREE
386 *Interface(MyIfaceUnion) 431 *Interface(MyIfaceUnion)
387 * Attribute(foo) 432 * Attribute(foo)
388 * Type() 433 * Type()
389 * UnionType() 434 * UnionType()
390 * Type() 435 * Type()
391 * PrimitiveType(DOMString) 436 * StringType(DOMString)
392 * Type() 437 * Type()
393 * PrimitiveType(long) 438 * PrimitiveType(long)
394 */ 439 */
395 interface MyIfaceUnion { 440 interface MyIfaceUnion {
396 attribute (DOMString or long) foo; 441 attribute (DOMString or long) foo;
397 }; 442 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698