Remove APIPermission::kFileSystemWriteDirectory
[chromium-blink-merge.git] / tools / idl_parser / test_parser / dictionary_web.idl
blob2fd602e1491e005165e652c0359d81d5dd24d544
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
3 found in the LICENSE file. */
5 /* Test Dictionary productions
7 Run with --test to generate an AST and verify that all comments accurately
8 reflect the state of the Nodes.
10 BUILD Type(Name)
11 This comment signals that a node of type <Type> is created with the
12 name <Name>.
14 ERROR Error String
15 This comment signals that a error of <Error String> is generated. The error
16 is not assigned to a node, but are expected in order.
18 PROP Key=Value
19 This comment signals that a property has been set on the Node such that
20 <Key> = <Value>.
22 TREE
23 Type(Name)
24 Type(Name)
25 Type(Name)
26 Type(Name)
27 ...
28 This comment signals that a tree of nodes matching the BUILD comment
29 symatics should exist. This is an exact match.
33 /* TREE
34 *Dictionary(MyDict)
36 dictionary MyDict { };
38 /* TREE
39 *Dictionary(MyDictInherit)
40 * Inherit(Foo)
42 dictionary MyDictInherit : Foo {};
44 /* TREE
45 *Dictionary(MyDictPartial)
47 partial dictionary MyDictPartial { };
49 /* ERROR Unexpected ":" after identifier "MyDictInherit". */
50 partial dictionary MyDictInherit : Foo {};
52 /* TREE
53 *Dictionary(MyDictBig)
54 * Key(setString)
55 * Type()
56 * PrimitiveType(DOMString)
57 * Default(Foo)
58 * Key(setLong)
59 * Type()
60 * PrimitiveType(unsigned long long)
61 * Default(123)
62 * Key(unsetLong)
63 * Type()
64 * PrimitiveType(long)
66 dictionary MyDictBig {
67 DOMString setString = "Foo";
68 unsigned long long setLong = 123;
69 long unsetLong;
72 /* TREE
73 *Dictionary(MyDictRequired)
74 * Key(setLong)
75 * Type()
76 * PrimitiveType(long)
78 dictionary MyDictRequired {
79 required long setLong;
82 /* ERROR Unexpected "{" after keyword "dictionary". */
83 dictionary {
84 DOMString? setString = null;
87 /* TREE
88 *Dictionary(MyDictionaryInvalidOptional)
89 * Key(mandatory)
90 * Type()
91 * PrimitiveType(DOMString)
92 * Error(Unexpected keyword "optional" after ">".)
94 dictionary MyDictionaryInvalidOptional {
95 DOMString mandatory;
96 sequence<DOMString> optional;
99 /* ERROR Unexpected identifier "NoColon" after identifier "ForParent". */
100 dictionary ForParent NoColon {
101 DOMString? setString = null;
104 /* TREE
105 *Dictionary(MyDictNull)
106 * Key(setString)
107 * Type()
108 * PrimitiveType(DOMString)
109 * Default(NULL)
111 dictionary MyDictNull {
112 DOMString? setString = null;
115 /* ERROR Unexpected keyword "attribute" after "{". */
116 dictionary MyDictUnexpectedAttribute {
117 attribute DOMString foo = "";