goatlint-parser 0.125.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,220 @@
1
+ // Auto-generated code, DO NOT EDIT DIRECTLY!
2
+ // To edit this generated file you have to edit `tasks/ast_tools/src/generators/estree_visit.rs`.
3
+
4
+ const { freeze } = Object;
5
+
6
+ const $EMPTY = freeze([]),
7
+ DECORATORS__KEY__TYPE_ANNOTATION__VALUE = freeze([
8
+ "decorators",
9
+ "key",
10
+ "typeAnnotation",
11
+ "value",
12
+ ]),
13
+ LEFT__RIGHT = freeze(["left", "right"]),
14
+ ARGUMENT = freeze(["argument"]),
15
+ BODY = freeze(["body"]),
16
+ LABEL = freeze(["label"]),
17
+ CALLEE__TYPE_ARGUMENTS__ARGUMENTS = freeze(["callee", "typeArguments", "arguments"]),
18
+ EXPRESSION = freeze(["expression"]),
19
+ DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY = freeze([
20
+ "decorators",
21
+ "id",
22
+ "typeParameters",
23
+ "superClass",
24
+ "superTypeArguments",
25
+ "implements",
26
+ "body",
27
+ ]),
28
+ TEST__CONSEQUENT__ALTERNATE = freeze(["test", "consequent", "alternate"]),
29
+ LEFT__RIGHT__BODY = freeze(["left", "right", "body"]),
30
+ ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY = freeze([
31
+ "id",
32
+ "typeParameters",
33
+ "params",
34
+ "returnType",
35
+ "body",
36
+ ]),
37
+ KEY__VALUE = freeze(["key", "value"]),
38
+ LOCAL = freeze(["local"]),
39
+ OBJECT__PROPERTY = freeze(["object", "property"]),
40
+ DECORATORS__KEY__TYPE_ANNOTATION = freeze(["decorators", "key", "typeAnnotation"]),
41
+ EXPRESSION__TYPE_ANNOTATION = freeze(["expression", "typeAnnotation"]),
42
+ TYPE_PARAMETERS__PARAMS__RETURN_TYPE = freeze(["typeParameters", "params", "returnType"]),
43
+ EXPRESSION__TYPE_ARGUMENTS = freeze(["expression", "typeArguments"]),
44
+ MEMBERS = freeze(["members"]),
45
+ ID__BODY = freeze(["id", "body"]),
46
+ TYPES = freeze(["types"]),
47
+ TYPE_ANNOTATION = freeze(["typeAnnotation"]),
48
+ PARAMS = freeze(["params"]);
49
+
50
+ export default freeze({
51
+ // Leaf nodes
52
+ DebuggerStatement: $EMPTY,
53
+ EmptyStatement: $EMPTY,
54
+ Literal: $EMPTY,
55
+ PrivateIdentifier: $EMPTY,
56
+ Super: $EMPTY,
57
+ TemplateElement: $EMPTY,
58
+ ThisExpression: $EMPTY,
59
+ JSXClosingFragment: $EMPTY,
60
+ JSXEmptyExpression: $EMPTY,
61
+ JSXIdentifier: $EMPTY,
62
+ JSXOpeningFragment: $EMPTY,
63
+ JSXText: $EMPTY,
64
+ TSAnyKeyword: $EMPTY,
65
+ TSBigIntKeyword: $EMPTY,
66
+ TSBooleanKeyword: $EMPTY,
67
+ TSIntrinsicKeyword: $EMPTY,
68
+ TSJSDocUnknownType: $EMPTY,
69
+ TSNeverKeyword: $EMPTY,
70
+ TSNullKeyword: $EMPTY,
71
+ TSNumberKeyword: $EMPTY,
72
+ TSObjectKeyword: $EMPTY,
73
+ TSStringKeyword: $EMPTY,
74
+ TSSymbolKeyword: $EMPTY,
75
+ TSThisType: $EMPTY,
76
+ TSUndefinedKeyword: $EMPTY,
77
+ TSUnknownKeyword: $EMPTY,
78
+ TSVoidKeyword: $EMPTY,
79
+ // Non-leaf nodes
80
+ AccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION__VALUE,
81
+ ArrayExpression: freeze(["elements"]),
82
+ ArrayPattern: freeze(["decorators", "elements", "typeAnnotation"]),
83
+ ArrowFunctionExpression: freeze(["typeParameters", "params", "returnType", "body"]),
84
+ AssignmentExpression: LEFT__RIGHT,
85
+ AssignmentPattern: freeze(["decorators", "left", "right", "typeAnnotation"]),
86
+ AwaitExpression: ARGUMENT,
87
+ BinaryExpression: LEFT__RIGHT,
88
+ BlockStatement: BODY,
89
+ BreakStatement: LABEL,
90
+ CallExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS,
91
+ CatchClause: freeze(["param", "body"]),
92
+ ChainExpression: EXPRESSION,
93
+ ClassBody: BODY,
94
+ ClassDeclaration:
95
+ DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY,
96
+ ClassExpression:
97
+ DECORATORS__ID__TYPE_PARAMETERS__SUPER_CLASS__SUPER_TYPE_ARGUMENTS__IMPLEMENTS__BODY,
98
+ ConditionalExpression: TEST__CONSEQUENT__ALTERNATE,
99
+ ContinueStatement: LABEL,
100
+ Decorator: EXPRESSION,
101
+ DoWhileStatement: freeze(["body", "test"]),
102
+ ExportAllDeclaration: freeze(["exported", "source", "attributes"]),
103
+ ExportDefaultDeclaration: freeze(["declaration"]),
104
+ ExportNamedDeclaration: freeze(["declaration", "specifiers", "source", "attributes"]),
105
+ ExportSpecifier: freeze(["local", "exported"]),
106
+ ExpressionStatement: EXPRESSION,
107
+ ForInStatement: LEFT__RIGHT__BODY,
108
+ ForOfStatement: LEFT__RIGHT__BODY,
109
+ ForStatement: freeze(["init", "test", "update", "body"]),
110
+ FunctionDeclaration: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
111
+ FunctionExpression: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
112
+ Identifier: freeze(["decorators", "typeAnnotation"]),
113
+ IfStatement: TEST__CONSEQUENT__ALTERNATE,
114
+ ImportAttribute: KEY__VALUE,
115
+ ImportDeclaration: freeze(["specifiers", "source", "attributes"]),
116
+ ImportDefaultSpecifier: LOCAL,
117
+ ImportExpression: freeze(["source", "options"]),
118
+ ImportNamespaceSpecifier: LOCAL,
119
+ ImportSpecifier: freeze(["imported", "local"]),
120
+ LabeledStatement: freeze(["label", "body"]),
121
+ LogicalExpression: LEFT__RIGHT,
122
+ MemberExpression: OBJECT__PROPERTY,
123
+ MetaProperty: freeze(["meta", "property"]),
124
+ MethodDefinition: freeze(["decorators", "key", "value"]),
125
+ NewExpression: CALLEE__TYPE_ARGUMENTS__ARGUMENTS,
126
+ ObjectExpression: freeze(["properties"]),
127
+ ObjectPattern: freeze(["decorators", "properties", "typeAnnotation"]),
128
+ ParenthesizedExpression: EXPRESSION,
129
+ Program: BODY,
130
+ Property: KEY__VALUE,
131
+ PropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION__VALUE,
132
+ RestElement: freeze(["decorators", "argument", "typeAnnotation"]),
133
+ ReturnStatement: ARGUMENT,
134
+ SequenceExpression: freeze(["expressions"]),
135
+ SpreadElement: ARGUMENT,
136
+ StaticBlock: BODY,
137
+ SwitchCase: freeze(["test", "consequent"]),
138
+ SwitchStatement: freeze(["discriminant", "cases"]),
139
+ TaggedTemplateExpression: freeze(["tag", "typeArguments", "quasi"]),
140
+ TemplateLiteral: freeze(["quasis", "expressions"]),
141
+ ThrowStatement: ARGUMENT,
142
+ TryStatement: freeze(["block", "handler", "finalizer"]),
143
+ UnaryExpression: ARGUMENT,
144
+ UpdateExpression: ARGUMENT,
145
+ V8IntrinsicExpression: freeze(["name", "arguments"]),
146
+ VariableDeclaration: freeze(["declarations"]),
147
+ VariableDeclarator: freeze(["id", "init"]),
148
+ WhileStatement: freeze(["test", "body"]),
149
+ WithStatement: freeze(["object", "body"]),
150
+ YieldExpression: ARGUMENT,
151
+ JSXAttribute: freeze(["name", "value"]),
152
+ JSXClosingElement: freeze(["name"]),
153
+ JSXElement: freeze(["openingElement", "children", "closingElement"]),
154
+ JSXExpressionContainer: EXPRESSION,
155
+ JSXFragment: freeze(["openingFragment", "children", "closingFragment"]),
156
+ JSXMemberExpression: OBJECT__PROPERTY,
157
+ JSXNamespacedName: freeze(["namespace", "name"]),
158
+ JSXOpeningElement: freeze(["name", "typeArguments", "attributes"]),
159
+ JSXSpreadAttribute: ARGUMENT,
160
+ JSXSpreadChild: EXPRESSION,
161
+ TSAbstractAccessorProperty: DECORATORS__KEY__TYPE_ANNOTATION,
162
+ TSAbstractMethodDefinition: KEY__VALUE,
163
+ TSAbstractPropertyDefinition: DECORATORS__KEY__TYPE_ANNOTATION,
164
+ TSArrayType: freeze(["elementType"]),
165
+ TSAsExpression: EXPRESSION__TYPE_ANNOTATION,
166
+ TSCallSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
167
+ TSClassImplements: EXPRESSION__TYPE_ARGUMENTS,
168
+ TSConditionalType: freeze(["checkType", "extendsType", "trueType", "falseType"]),
169
+ TSConstructSignatureDeclaration: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
170
+ TSConstructorType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
171
+ TSDeclareFunction: ID__TYPE_PARAMETERS__PARAMS__RETURN_TYPE__BODY,
172
+ TSEmptyBodyFunctionExpression: freeze(["id", "typeParameters", "params", "returnType"]),
173
+ TSEnumBody: MEMBERS,
174
+ TSEnumDeclaration: ID__BODY,
175
+ TSEnumMember: freeze(["id", "initializer"]),
176
+ TSExportAssignment: EXPRESSION,
177
+ TSExternalModuleReference: EXPRESSION,
178
+ TSFunctionType: TYPE_PARAMETERS__PARAMS__RETURN_TYPE,
179
+ TSImportEqualsDeclaration: freeze(["id", "moduleReference"]),
180
+ TSImportType: freeze(["source", "options", "qualifier", "typeArguments"]),
181
+ TSIndexSignature: freeze(["parameters", "typeAnnotation"]),
182
+ TSIndexedAccessType: freeze(["objectType", "indexType"]),
183
+ TSInferType: freeze(["typeParameter"]),
184
+ TSInstantiationExpression: EXPRESSION__TYPE_ARGUMENTS,
185
+ TSInterfaceBody: BODY,
186
+ TSInterfaceDeclaration: freeze(["id", "typeParameters", "extends", "body"]),
187
+ TSInterfaceHeritage: EXPRESSION__TYPE_ARGUMENTS,
188
+ TSIntersectionType: TYPES,
189
+ TSJSDocNonNullableType: TYPE_ANNOTATION,
190
+ TSJSDocNullableType: TYPE_ANNOTATION,
191
+ TSLiteralType: freeze(["literal"]),
192
+ TSMappedType: freeze(["key", "constraint", "nameType", "typeAnnotation"]),
193
+ TSMethodSignature: freeze(["key", "typeParameters", "params", "returnType"]),
194
+ TSModuleBlock: BODY,
195
+ TSModuleDeclaration: ID__BODY,
196
+ TSNamedTupleMember: freeze(["label", "elementType"]),
197
+ TSNamespaceExportDeclaration: freeze(["id"]),
198
+ TSNonNullExpression: EXPRESSION,
199
+ TSOptionalType: TYPE_ANNOTATION,
200
+ TSParameterProperty: freeze(["decorators", "parameter"]),
201
+ TSParenthesizedType: TYPE_ANNOTATION,
202
+ TSPropertySignature: freeze(["key", "typeAnnotation"]),
203
+ TSQualifiedName: LEFT__RIGHT,
204
+ TSRestType: TYPE_ANNOTATION,
205
+ TSSatisfiesExpression: EXPRESSION__TYPE_ANNOTATION,
206
+ TSTemplateLiteralType: freeze(["quasis", "types"]),
207
+ TSTupleType: freeze(["elementTypes"]),
208
+ TSTypeAliasDeclaration: freeze(["id", "typeParameters", "typeAnnotation"]),
209
+ TSTypeAnnotation: TYPE_ANNOTATION,
210
+ TSTypeAssertion: freeze(["typeAnnotation", "expression"]),
211
+ TSTypeLiteral: MEMBERS,
212
+ TSTypeOperator: TYPE_ANNOTATION,
213
+ TSTypeParameter: freeze(["name", "constraint", "default"]),
214
+ TSTypeParameterDeclaration: PARAMS,
215
+ TSTypeParameterInstantiation: PARAMS,
216
+ TSTypePredicate: freeze(["parameterName", "typeAnnotation"]),
217
+ TSTypeQuery: freeze(["exprName", "typeArguments"]),
218
+ TSTypeReference: freeze(["typeName", "typeArguments"]),
219
+ TSUnionType: TYPES,
220
+ });
@@ -0,0 +1,177 @@
1
+ // Auto-generated code, DO NOT EDIT DIRECTLY!
2
+ // To edit this generated file you have to edit `tasks/ast_tools/src/generators/estree_visit.rs`.
3
+
4
+ /** Mapping from node type name to node type ID */
5
+ export const NODE_TYPE_IDS_MAP = new Map([
6
+ ["DebuggerStatement", 0],
7
+ ["EmptyStatement", 1],
8
+ ["Literal", 2],
9
+ ["PrivateIdentifier", 3],
10
+ ["Super", 4],
11
+ ["TemplateElement", 5],
12
+ ["ThisExpression", 6],
13
+ ["JSXClosingFragment", 7],
14
+ ["JSXEmptyExpression", 8],
15
+ ["JSXIdentifier", 9],
16
+ ["JSXOpeningFragment", 10],
17
+ ["JSXText", 11],
18
+ ["TSAnyKeyword", 12],
19
+ ["TSBigIntKeyword", 13],
20
+ ["TSBooleanKeyword", 14],
21
+ ["TSIntrinsicKeyword", 15],
22
+ ["TSJSDocUnknownType", 16],
23
+ ["TSNeverKeyword", 17],
24
+ ["TSNullKeyword", 18],
25
+ ["TSNumberKeyword", 19],
26
+ ["TSObjectKeyword", 20],
27
+ ["TSStringKeyword", 21],
28
+ ["TSSymbolKeyword", 22],
29
+ ["TSThisType", 23],
30
+ ["TSUndefinedKeyword", 24],
31
+ ["TSUnknownKeyword", 25],
32
+ ["TSVoidKeyword", 26],
33
+ ["AccessorProperty", 27],
34
+ ["ArrayExpression", 28],
35
+ ["ArrayPattern", 29],
36
+ ["ArrowFunctionExpression", 30],
37
+ ["AssignmentExpression", 31],
38
+ ["AssignmentPattern", 32],
39
+ ["AwaitExpression", 33],
40
+ ["BinaryExpression", 34],
41
+ ["BlockStatement", 35],
42
+ ["BreakStatement", 36],
43
+ ["CallExpression", 37],
44
+ ["CatchClause", 38],
45
+ ["ChainExpression", 39],
46
+ ["ClassBody", 40],
47
+ ["ClassDeclaration", 41],
48
+ ["ClassExpression", 42],
49
+ ["ConditionalExpression", 43],
50
+ ["ContinueStatement", 44],
51
+ ["Decorator", 45],
52
+ ["DoWhileStatement", 46],
53
+ ["ExportAllDeclaration", 47],
54
+ ["ExportDefaultDeclaration", 48],
55
+ ["ExportNamedDeclaration", 49],
56
+ ["ExportSpecifier", 50],
57
+ ["ExpressionStatement", 51],
58
+ ["ForInStatement", 52],
59
+ ["ForOfStatement", 53],
60
+ ["ForStatement", 54],
61
+ ["FunctionDeclaration", 55],
62
+ ["FunctionExpression", 56],
63
+ ["Identifier", 57],
64
+ ["IfStatement", 58],
65
+ ["ImportAttribute", 59],
66
+ ["ImportDeclaration", 60],
67
+ ["ImportDefaultSpecifier", 61],
68
+ ["ImportExpression", 62],
69
+ ["ImportNamespaceSpecifier", 63],
70
+ ["ImportSpecifier", 64],
71
+ ["LabeledStatement", 65],
72
+ ["LogicalExpression", 66],
73
+ ["MemberExpression", 67],
74
+ ["MetaProperty", 68],
75
+ ["MethodDefinition", 69],
76
+ ["NewExpression", 70],
77
+ ["ObjectExpression", 71],
78
+ ["ObjectPattern", 72],
79
+ ["ParenthesizedExpression", 73],
80
+ ["Program", 74],
81
+ ["Property", 75],
82
+ ["PropertyDefinition", 76],
83
+ ["RestElement", 77],
84
+ ["ReturnStatement", 78],
85
+ ["SequenceExpression", 79],
86
+ ["SpreadElement", 80],
87
+ ["StaticBlock", 81],
88
+ ["SwitchCase", 82],
89
+ ["SwitchStatement", 83],
90
+ ["TaggedTemplateExpression", 84],
91
+ ["TemplateLiteral", 85],
92
+ ["ThrowStatement", 86],
93
+ ["TryStatement", 87],
94
+ ["UnaryExpression", 88],
95
+ ["UpdateExpression", 89],
96
+ ["V8IntrinsicExpression", 90],
97
+ ["VariableDeclaration", 91],
98
+ ["VariableDeclarator", 92],
99
+ ["WhileStatement", 93],
100
+ ["WithStatement", 94],
101
+ ["YieldExpression", 95],
102
+ ["JSXAttribute", 96],
103
+ ["JSXClosingElement", 97],
104
+ ["JSXElement", 98],
105
+ ["JSXExpressionContainer", 99],
106
+ ["JSXFragment", 100],
107
+ ["JSXMemberExpression", 101],
108
+ ["JSXNamespacedName", 102],
109
+ ["JSXOpeningElement", 103],
110
+ ["JSXSpreadAttribute", 104],
111
+ ["JSXSpreadChild", 105],
112
+ ["TSAbstractAccessorProperty", 106],
113
+ ["TSAbstractMethodDefinition", 107],
114
+ ["TSAbstractPropertyDefinition", 108],
115
+ ["TSArrayType", 109],
116
+ ["TSAsExpression", 110],
117
+ ["TSCallSignatureDeclaration", 111],
118
+ ["TSClassImplements", 112],
119
+ ["TSConditionalType", 113],
120
+ ["TSConstructSignatureDeclaration", 114],
121
+ ["TSConstructorType", 115],
122
+ ["TSDeclareFunction", 116],
123
+ ["TSEmptyBodyFunctionExpression", 117],
124
+ ["TSEnumBody", 118],
125
+ ["TSEnumDeclaration", 119],
126
+ ["TSEnumMember", 120],
127
+ ["TSExportAssignment", 121],
128
+ ["TSExternalModuleReference", 122],
129
+ ["TSFunctionType", 123],
130
+ ["TSImportEqualsDeclaration", 124],
131
+ ["TSImportType", 125],
132
+ ["TSIndexSignature", 126],
133
+ ["TSIndexedAccessType", 127],
134
+ ["TSInferType", 128],
135
+ ["TSInstantiationExpression", 129],
136
+ ["TSInterfaceBody", 130],
137
+ ["TSInterfaceDeclaration", 131],
138
+ ["TSInterfaceHeritage", 132],
139
+ ["TSIntersectionType", 133],
140
+ ["TSJSDocNonNullableType", 134],
141
+ ["TSJSDocNullableType", 135],
142
+ ["TSLiteralType", 136],
143
+ ["TSMappedType", 137],
144
+ ["TSMethodSignature", 138],
145
+ ["TSModuleBlock", 139],
146
+ ["TSModuleDeclaration", 140],
147
+ ["TSNamedTupleMember", 141],
148
+ ["TSNamespaceExportDeclaration", 142],
149
+ ["TSNonNullExpression", 143],
150
+ ["TSOptionalType", 144],
151
+ ["TSParameterProperty", 145],
152
+ ["TSParenthesizedType", 146],
153
+ ["TSPropertySignature", 147],
154
+ ["TSQualifiedName", 148],
155
+ ["TSRestType", 149],
156
+ ["TSSatisfiesExpression", 150],
157
+ ["TSTemplateLiteralType", 151],
158
+ ["TSTupleType", 152],
159
+ ["TSTypeAliasDeclaration", 153],
160
+ ["TSTypeAnnotation", 154],
161
+ ["TSTypeAssertion", 155],
162
+ ["TSTypeLiteral", 156],
163
+ ["TSTypeOperator", 157],
164
+ ["TSTypeParameter", 158],
165
+ ["TSTypeParameterDeclaration", 159],
166
+ ["TSTypeParameterInstantiation", 160],
167
+ ["TSTypePredicate", 161],
168
+ ["TSTypeQuery", 162],
169
+ ["TSTypeReference", 163],
170
+ ["TSUnionType", 164],
171
+ ]);
172
+
173
+ /** Count of all node types (both leaf and non-leaf nodes) */
174
+ export const NODE_TYPES_COUNT = 165;
175
+
176
+ /** Count of leaf node types */
177
+ export const LEAF_NODE_TYPES_COUNT = 27;