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.
11 This comment signals that a node of type <Type> is created with the
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.
19 This comment signals that a property has been set on the Node such that
28 This comment signals that a tree of nodes matching the BUILD comment
29 symatics should exist. This is an exact match.
36 dictionary MyDict
{ };
39 *Dictionary(MyDictInherit)
42 dictionary MyDictInherit
: Foo
{};
45 *Dictionary(MyDictPartial)
47 partial dictionary MyDictPartial
{ };
49 /* ERROR Unexpected ":" after identifier "MyDictInherit". */
50 partial dictionary MyDictInherit
: Foo
{};
53 *Dictionary(MyDictBig)
56 * PrimitiveType(DOMString)
60 * PrimitiveType(unsigned long long)
66 dictionary MyDictBig
{
67 DOMString setString
= "Foo";
68 unsigned long long setLong
= 123;
73 *Dictionary(MyDictRequired)
78 dictionary MyDictRequired
{
79 required
long setLong
;
82 /* ERROR Unexpected "{" after keyword "dictionary". */
84 DOMString? setString
= null
;
88 /* ERROR Unexpected identifier "NoColon" after identifier "ForParent". */
89 dictionary ForParent NoColon
{
90 DOMString? setString
= null
;
94 *Dictionary(MyDictNull)
97 * PrimitiveType(DOMString)
100 dictionary MyDictNull
{
101 DOMString? setString
= null
;
104 /* ERROR Unexpected keyword "attribute" after "{". */
105 dictionary MyDictUnexpectedAttribute
{
106 attribute DOMString foo
= "";