1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
/* Copyright 2017 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. */
/* Test Namespace productions
Run with --test to generate an AST and verify that all comments accurately
reflect the state of the Nodes.
TREE
Type(Name)
Type(Name)
Type(Name)
Type(Name)
...
This comment signals that a tree of nodes matching the BUILD comment
symatics should exist. This is an exact match.
*/
/** TREE
*Namespace(MyNamespace)
*/
namespace MyNamespace { };
/** TREE
*Namespace(MyNamespace2)
* Const(FOO)
* PrimitiveType(long)
* Value() = "1"
* Operation(fooLong)
* Arguments()
* Type()
* PrimitiveType(long)
* Operation(voidArgLong)
* Arguments()
* Argument(arg)
* Type()
* PrimitiveType(long)
* Type()
* PrimitiveType(void)
*/
namespace MyNamespace2 {
const long FOO = 1;
long fooLong();
void voidArgLong(long arg);
};
/** TREE
*Namespace(MyNamespaceMissingArgument)
* Operation(foo)
* Arguments()
* Argument(arg)
* Type()
* StringType(DOMString)
* Error(Missing argument.)
* Type()
* PrimitiveType(void)
*/
namespace MyNamespaceMissingArgument {
void foo(DOMString arg, );
};
/** TREE
*Namespace(VectorUtils)
* Attribute(unit)
* READONLY: True
* Type()
* Typeref(Vector)
* Operation(dotProduct)
* Arguments()
* Argument(x)
* Type()
* Typeref(Vector)
* Argument(y)
* Type()
* Typeref(Vector)
* Type()
* PrimitiveType(double)
* Operation(crossProduct)
* Arguments()
* Argument(x)
* Type()
* Typeref(Vector)
* Argument(y)
* Type()
* Typeref(Vector)
* Type()
* Typeref(Vector)
*/
namespace VectorUtils {
readonly attribute Vector unit;
double dotProduct(Vector x, Vector y);
Vector crossProduct(Vector x, Vector y);
};
/**TREE
*Namespace(ErrorOnlyExtAttrs)
* Error(Unexpected ";" after "]".)
*/
namespace ErrorOnlyExtAttrs {
[Clamp];
};
/** TREE
*Error(Unexpected keyword "attribute" after "{".)
*/
namespace ErrorNonReadonly {
attribute Vector unit2;
};
/** TREE
*Error(Unexpected ";" after "{".)
*/
namespace NameSpaceError {
;
/**TREE
*Namespace(PartialNamespace)
* PARTIAL: True
* Operation(fooLong)
* Arguments()
* Type()
* PrimitiveType(long)
*/
partial namespace PartialNamespace {
long fooLong();
};
/** TREE
*Namespace(NamespaceWithExtAttrs)
* Operation(fooLong)
* Arguments()
* Type()
* PrimitiveType(long)
* ExtAttributes()
* ExtAttribute(Replaceable)
*/
[Replaceable] namespace NamespaceWithExtAttrs {
long fooLong();
};
/** TREE
*Namespace(NamespaceAnnotatedTypeMember)
* Operation(fooLong)
* Arguments()
* Type()
* PrimitiveType(long)
* ExtAttributes()
* ExtAttribute(Clamp)
*/
namespace NamespaceAnnotatedTypeMember {
[Clamp] long fooLong();
};
|