Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/parser/qqmljsast_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | /**************************************************************************** | - | ||||||||||||||||||
2 | ** | - | ||||||||||||||||||
3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||||||||||||||
4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||||||||||||||
5 | ** | - | ||||||||||||||||||
6 | ** This file is part of the QtQml module of the Qt Toolkit. | - | ||||||||||||||||||
7 | ** | - | ||||||||||||||||||
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||||||||||||||
9 | ** Commercial License Usage | - | ||||||||||||||||||
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||||||||||||||
11 | ** accordance with the commercial license agreement provided with the | - | ||||||||||||||||||
12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||||||||||||||
13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||||||||||||||
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||||||||||||||
15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||||||||||||||
16 | ** | - | ||||||||||||||||||
17 | ** GNU Lesser General Public License Usage | - | ||||||||||||||||||
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||||||||||||||
19 | ** General Public License version 3 as published by the Free Software | - | ||||||||||||||||||
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||||||||||||||
21 | ** packaging of this file. Please review the following information to | - | ||||||||||||||||||
22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||||||||||||||
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||||||||||||||
24 | ** | - | ||||||||||||||||||
25 | ** GNU General Public License Usage | - | ||||||||||||||||||
26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||||||||||||||
27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||||||||||||||
28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||||||||||||||
29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||||||||||||||
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||||||||||||||
31 | ** included in the packaging of this file. Please review the following | - | ||||||||||||||||||
32 | ** information to ensure the GNU General Public License requirements will | - | ||||||||||||||||||
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||||||||||||||
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||||||||||||||
35 | ** | - | ||||||||||||||||||
36 | ** $QT_END_LICENSE$ | - | ||||||||||||||||||
37 | ** | - | ||||||||||||||||||
38 | ****************************************************************************/ | - | ||||||||||||||||||
39 | - | |||||||||||||||||||
40 | #ifndef QQMLJSAST_P_H | - | ||||||||||||||||||
41 | #define QQMLJSAST_P_H | - | ||||||||||||||||||
42 | - | |||||||||||||||||||
43 | // | - | ||||||||||||||||||
44 | // W A R N I N G | - | ||||||||||||||||||
45 | // ------------- | - | ||||||||||||||||||
46 | // | - | ||||||||||||||||||
47 | // This file is not part of the Qt API. It exists purely as an | - | ||||||||||||||||||
48 | // implementation detail. This header file may change from version to | - | ||||||||||||||||||
49 | // version without notice, or even be removed. | - | ||||||||||||||||||
50 | // | - | ||||||||||||||||||
51 | // We mean it. | - | ||||||||||||||||||
52 | // | - | ||||||||||||||||||
53 | - | |||||||||||||||||||
54 | #include "qqmljsastvisitor_p.h" | - | ||||||||||||||||||
55 | #include "qqmljsglobal_p.h" | - | ||||||||||||||||||
56 | #include "qqmljsmemorypool_p.h" | - | ||||||||||||||||||
57 | - | |||||||||||||||||||
58 | #include <QtCore/qstring.h> | - | ||||||||||||||||||
59 | - | |||||||||||||||||||
60 | QT_QML_BEGIN_NAMESPACE | - | ||||||||||||||||||
61 | - | |||||||||||||||||||
62 | #define QQMLJS_DECLARE_AST_NODE(name) \ | - | ||||||||||||||||||
63 | enum { K = Kind_##name }; | - | ||||||||||||||||||
64 | - | |||||||||||||||||||
65 | namespace QSOperator // ### rename | - | ||||||||||||||||||
66 | { | - | ||||||||||||||||||
67 | - | |||||||||||||||||||
68 | enum Op { | - | ||||||||||||||||||
69 | Add, | - | ||||||||||||||||||
70 | And, | - | ||||||||||||||||||
71 | InplaceAnd, | - | ||||||||||||||||||
72 | Assign, | - | ||||||||||||||||||
73 | BitAnd, | - | ||||||||||||||||||
74 | BitOr, | - | ||||||||||||||||||
75 | BitXor, | - | ||||||||||||||||||
76 | InplaceSub, | - | ||||||||||||||||||
77 | Div, | - | ||||||||||||||||||
78 | InplaceDiv, | - | ||||||||||||||||||
79 | Equal, | - | ||||||||||||||||||
80 | Exp, | - | ||||||||||||||||||
81 | InplaceExp, | - | ||||||||||||||||||
82 | Ge, | - | ||||||||||||||||||
83 | Gt, | - | ||||||||||||||||||
84 | In, | - | ||||||||||||||||||
85 | InplaceAdd, | - | ||||||||||||||||||
86 | InstanceOf, | - | ||||||||||||||||||
87 | Le, | - | ||||||||||||||||||
88 | LShift, | - | ||||||||||||||||||
89 | InplaceLeftShift, | - | ||||||||||||||||||
90 | Lt, | - | ||||||||||||||||||
91 | Mod, | - | ||||||||||||||||||
92 | InplaceMod, | - | ||||||||||||||||||
93 | Mul, | - | ||||||||||||||||||
94 | InplaceMul, | - | ||||||||||||||||||
95 | NotEqual, | - | ||||||||||||||||||
96 | Or, | - | ||||||||||||||||||
97 | InplaceOr, | - | ||||||||||||||||||
98 | RShift, | - | ||||||||||||||||||
99 | InplaceRightShift, | - | ||||||||||||||||||
100 | StrictEqual, | - | ||||||||||||||||||
101 | StrictNotEqual, | - | ||||||||||||||||||
102 | Sub, | - | ||||||||||||||||||
103 | URShift, | - | ||||||||||||||||||
104 | InplaceURightShift, | - | ||||||||||||||||||
105 | InplaceXor, | - | ||||||||||||||||||
106 | Invalid | - | ||||||||||||||||||
107 | }; | - | ||||||||||||||||||
108 | - | |||||||||||||||||||
109 | } // namespace QSOperator | - | ||||||||||||||||||
110 | - | |||||||||||||||||||
111 | namespace QQmlJS { | - | ||||||||||||||||||
112 | - | |||||||||||||||||||
113 | namespace AST { | - | ||||||||||||||||||
114 | - | |||||||||||||||||||
115 | enum class VariableScope { | - | ||||||||||||||||||
116 | NoScope, | - | ||||||||||||||||||
117 | Var, | - | ||||||||||||||||||
118 | Let, | - | ||||||||||||||||||
119 | Const | - | ||||||||||||||||||
120 | }; | - | ||||||||||||||||||
121 | - | |||||||||||||||||||
122 | template <typename T1, typename T2> | - | ||||||||||||||||||
123 | T1 cast(T2 *ast) | - | ||||||||||||||||||
124 | { | - | ||||||||||||||||||
125 | if (ast && ast->kind == static_cast<T1>(0)->K)
| 523008-53218261 | ||||||||||||||||||
126 | return static_cast<T1>(ast); executed 11951924 times by 148 tests: return static_cast<T1>(ast); Executed by:
| 11951924 | ||||||||||||||||||
127 | - | |||||||||||||||||||
128 | return 0; executed 41821313 times by 148 tests: return 0; Executed by:
| 41821313 | ||||||||||||||||||
129 | } | - | ||||||||||||||||||
130 | - | |||||||||||||||||||
131 | FunctionExpression *asAnonymousFunctionDefinition(AST::Node *n); | - | ||||||||||||||||||
132 | ClassExpression *asAnonymousClassDefinition(AST::Node *n); | - | ||||||||||||||||||
133 | - | |||||||||||||||||||
134 | class QML_PARSER_EXPORT Node: public Managed | - | ||||||||||||||||||
135 | { | - | ||||||||||||||||||
136 | public: | - | ||||||||||||||||||
137 | enum Kind { | - | ||||||||||||||||||
138 | Kind_Undefined, | - | ||||||||||||||||||
139 | - | |||||||||||||||||||
140 | Kind_ArgumentList, | - | ||||||||||||||||||
141 | Kind_ArrayPattern, | - | ||||||||||||||||||
142 | Kind_ArrayMemberExpression, | - | ||||||||||||||||||
143 | Kind_BinaryExpression, | - | ||||||||||||||||||
144 | Kind_Block, | - | ||||||||||||||||||
145 | Kind_BreakStatement, | - | ||||||||||||||||||
146 | Kind_CallExpression, | - | ||||||||||||||||||
147 | Kind_CaseBlock, | - | ||||||||||||||||||
148 | Kind_CaseClause, | - | ||||||||||||||||||
149 | Kind_CaseClauses, | - | ||||||||||||||||||
150 | Kind_Catch, | - | ||||||||||||||||||
151 | Kind_ConditionalExpression, | - | ||||||||||||||||||
152 | Kind_ContinueStatement, | - | ||||||||||||||||||
153 | Kind_DebuggerStatement, | - | ||||||||||||||||||
154 | Kind_DefaultClause, | - | ||||||||||||||||||
155 | Kind_DeleteExpression, | - | ||||||||||||||||||
156 | Kind_DoWhileStatement, | - | ||||||||||||||||||
157 | Kind_ElementList, | - | ||||||||||||||||||
158 | Kind_Elision, | - | ||||||||||||||||||
159 | Kind_EmptyStatement, | - | ||||||||||||||||||
160 | Kind_Expression, | - | ||||||||||||||||||
161 | Kind_ExpressionStatement, | - | ||||||||||||||||||
162 | Kind_FalseLiteral, | - | ||||||||||||||||||
163 | Kind_SuperLiteral, | - | ||||||||||||||||||
164 | Kind_FieldMemberExpression, | - | ||||||||||||||||||
165 | Kind_Finally, | - | ||||||||||||||||||
166 | Kind_ForEachStatement, | - | ||||||||||||||||||
167 | Kind_ForStatement, | - | ||||||||||||||||||
168 | Kind_FormalParameterList, | - | ||||||||||||||||||
169 | Kind_FunctionBody, | - | ||||||||||||||||||
170 | Kind_FunctionDeclaration, | - | ||||||||||||||||||
171 | Kind_FunctionExpression, | - | ||||||||||||||||||
172 | Kind_ClassExpression, | - | ||||||||||||||||||
173 | Kind_ClassDeclaration, | - | ||||||||||||||||||
174 | Kind_IdentifierExpression, | - | ||||||||||||||||||
175 | Kind_IdentifierPropertyName, | - | ||||||||||||||||||
176 | Kind_ComputedPropertyName, | - | ||||||||||||||||||
177 | Kind_IfStatement, | - | ||||||||||||||||||
178 | Kind_LabelledStatement, | - | ||||||||||||||||||
179 | Kind_NewExpression, | - | ||||||||||||||||||
180 | Kind_NewMemberExpression, | - | ||||||||||||||||||
181 | Kind_NotExpression, | - | ||||||||||||||||||
182 | Kind_NullExpression, | - | ||||||||||||||||||
183 | Kind_YieldExpression, | - | ||||||||||||||||||
184 | Kind_NumericLiteral, | - | ||||||||||||||||||
185 | Kind_NumericLiteralPropertyName, | - | ||||||||||||||||||
186 | Kind_ObjectPattern, | - | ||||||||||||||||||
187 | Kind_PostDecrementExpression, | - | ||||||||||||||||||
188 | Kind_PostIncrementExpression, | - | ||||||||||||||||||
189 | Kind_PreDecrementExpression, | - | ||||||||||||||||||
190 | Kind_PreIncrementExpression, | - | ||||||||||||||||||
191 | Kind_Program, | - | ||||||||||||||||||
192 | Kind_PropertyDefinitionList, | - | ||||||||||||||||||
193 | Kind_PropertyGetterSetter, | - | ||||||||||||||||||
194 | Kind_PropertyName, | - | ||||||||||||||||||
195 | Kind_PropertyNameAndValue, | - | ||||||||||||||||||
196 | Kind_RegExpLiteral, | - | ||||||||||||||||||
197 | Kind_ReturnStatement, | - | ||||||||||||||||||
198 | Kind_StatementList, | - | ||||||||||||||||||
199 | Kind_StringLiteral, | - | ||||||||||||||||||
200 | Kind_StringLiteralPropertyName, | - | ||||||||||||||||||
201 | Kind_SwitchStatement, | - | ||||||||||||||||||
202 | Kind_TemplateLiteral, | - | ||||||||||||||||||
203 | Kind_TaggedTemplate, | - | ||||||||||||||||||
204 | Kind_ThisExpression, | - | ||||||||||||||||||
205 | Kind_ThrowStatement, | - | ||||||||||||||||||
206 | Kind_TildeExpression, | - | ||||||||||||||||||
207 | Kind_TrueLiteral, | - | ||||||||||||||||||
208 | Kind_TryStatement, | - | ||||||||||||||||||
209 | Kind_TypeOfExpression, | - | ||||||||||||||||||
210 | Kind_UnaryMinusExpression, | - | ||||||||||||||||||
211 | Kind_UnaryPlusExpression, | - | ||||||||||||||||||
212 | Kind_VariableDeclaration, | - | ||||||||||||||||||
213 | Kind_VariableDeclarationList, | - | ||||||||||||||||||
214 | Kind_VariableStatement, | - | ||||||||||||||||||
215 | Kind_VoidExpression, | - | ||||||||||||||||||
216 | Kind_WhileStatement, | - | ||||||||||||||||||
217 | Kind_WithStatement, | - | ||||||||||||||||||
218 | Kind_NestedExpression, | - | ||||||||||||||||||
219 | Kind_ClassElementList, | - | ||||||||||||||||||
220 | Kind_PatternElement, | - | ||||||||||||||||||
221 | Kind_PatternElementList, | - | ||||||||||||||||||
222 | Kind_PatternProperty, | - | ||||||||||||||||||
223 | Kind_PatternPropertyList, | - | ||||||||||||||||||
224 | - | |||||||||||||||||||
225 | - | |||||||||||||||||||
226 | Kind_UiArrayBinding, | - | ||||||||||||||||||
227 | Kind_UiImport, | - | ||||||||||||||||||
228 | Kind_UiObjectBinding, | - | ||||||||||||||||||
229 | Kind_UiObjectDefinition, | - | ||||||||||||||||||
230 | Kind_UiObjectInitializer, | - | ||||||||||||||||||
231 | Kind_UiObjectMemberList, | - | ||||||||||||||||||
232 | Kind_UiArrayMemberList, | - | ||||||||||||||||||
233 | Kind_UiPragma, | - | ||||||||||||||||||
234 | Kind_UiProgram, | - | ||||||||||||||||||
235 | Kind_UiParameterList, | - | ||||||||||||||||||
236 | Kind_UiPublicMember, | - | ||||||||||||||||||
237 | Kind_UiQualifiedId, | - | ||||||||||||||||||
238 | Kind_UiQualifiedPragmaId, | - | ||||||||||||||||||
239 | Kind_UiScriptBinding, | - | ||||||||||||||||||
240 | Kind_UiSourceElement, | - | ||||||||||||||||||
241 | Kind_UiHeaderItemList, | - | ||||||||||||||||||
242 | Kind_UiEnumDeclaration, | - | ||||||||||||||||||
243 | Kind_UiEnumMemberList | - | ||||||||||||||||||
244 | }; | - | ||||||||||||||||||
245 | - | |||||||||||||||||||
246 | inline Node() {} | - | ||||||||||||||||||
247 | - | |||||||||||||||||||
248 | // NOTE: node destructors are never called, | - | ||||||||||||||||||
249 | // instead we block free the memory | - | ||||||||||||||||||
250 | // (see the NodePool class) | - | ||||||||||||||||||
251 | virtual ~Node() {} | - | ||||||||||||||||||
252 | - | |||||||||||||||||||
253 | virtual ExpressionNode *expressionCast(); | - | ||||||||||||||||||
254 | virtual BinaryExpression *binaryExpressionCast(); | - | ||||||||||||||||||
255 | virtual Statement *statementCast(); | - | ||||||||||||||||||
256 | virtual UiObjectMember *uiObjectMemberCast(); | - | ||||||||||||||||||
257 | virtual LeftHandSideExpression *leftHandSideExpressionCast(); | - | ||||||||||||||||||
258 | virtual Pattern *patternCast(); | - | ||||||||||||||||||
259 | // implements the IsFunctionDefinition rules in the spec | - | ||||||||||||||||||
260 | virtual FunctionExpression *asFunctionDefinition(); | - | ||||||||||||||||||
261 | virtual ClassExpression *asClassDefinition(); | - | ||||||||||||||||||
262 | - | |||||||||||||||||||
263 | void accept(Visitor *visitor); | - | ||||||||||||||||||
264 | static void accept(Node *node, Visitor *visitor); | - | ||||||||||||||||||
265 | - | |||||||||||||||||||
266 | inline static void acceptChild(Node *node, Visitor *visitor) | - | ||||||||||||||||||
267 | { return accept(node, visitor); } // ### remove never executed: return accept(node, visitor); | 0 | ||||||||||||||||||
268 | - | |||||||||||||||||||
269 | virtual void accept0(Visitor *visitor) = 0; | - | ||||||||||||||||||
270 | virtual SourceLocation firstSourceLocation() const = 0; | - | ||||||||||||||||||
271 | virtual SourceLocation lastSourceLocation() const = 0; | - | ||||||||||||||||||
272 | - | |||||||||||||||||||
273 | // attributes | - | ||||||||||||||||||
274 | int kind = Kind_Undefined; | - | ||||||||||||||||||
275 | }; | - | ||||||||||||||||||
276 | - | |||||||||||||||||||
277 | class QML_PARSER_EXPORT ExpressionNode: public Node | - | ||||||||||||||||||
278 | { | - | ||||||||||||||||||
279 | public: | - | ||||||||||||||||||
280 | ExpressionNode() {} | - | ||||||||||||||||||
281 | - | |||||||||||||||||||
282 | ExpressionNode *expressionCast() override; | - | ||||||||||||||||||
283 | - | |||||||||||||||||||
284 | AST::FormalParameterList *reparseAsFormalParameterList(MemoryPool *pool); | - | ||||||||||||||||||
285 | - | |||||||||||||||||||
286 | }; | - | ||||||||||||||||||
287 | - | |||||||||||||||||||
288 | class QML_PARSER_EXPORT LeftHandSideExpression : public ExpressionNode | - | ||||||||||||||||||
289 | { | - | ||||||||||||||||||
290 | LeftHandSideExpression *leftHandSideExpressionCast() override; | - | ||||||||||||||||||
291 | }; | - | ||||||||||||||||||
292 | - | |||||||||||||||||||
293 | class QML_PARSER_EXPORT Statement: public Node | - | ||||||||||||||||||
294 | { | - | ||||||||||||||||||
295 | public: | - | ||||||||||||||||||
296 | Statement() {} | - | ||||||||||||||||||
297 | - | |||||||||||||||||||
298 | Statement *statementCast() override; | - | ||||||||||||||||||
299 | }; | - | ||||||||||||||||||
300 | - | |||||||||||||||||||
301 | class QML_PARSER_EXPORT NestedExpression: public LeftHandSideExpression | - | ||||||||||||||||||
302 | { | - | ||||||||||||||||||
303 | public: | - | ||||||||||||||||||
304 | QQMLJS_DECLARE_AST_NODE(NestedExpression) | - | ||||||||||||||||||
305 | - | |||||||||||||||||||
306 | NestedExpression(ExpressionNode *expression) | - | ||||||||||||||||||
307 | : expression(expression) | - | ||||||||||||||||||
308 | { kind = K; } executed 213698 times by 45 tests: end of block Executed by:
| 213698 | ||||||||||||||||||
309 | - | |||||||||||||||||||
310 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
311 | - | |||||||||||||||||||
312 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
313 | { return lparenToken; } executed 312417 times by 28 tests: return lparenToken; Executed by:
| 312417 | ||||||||||||||||||
314 | - | |||||||||||||||||||
315 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
316 | { return rparenToken; } executed 475441 times by 25 tests: return rparenToken; Executed by:
| 475441 | ||||||||||||||||||
317 | - | |||||||||||||||||||
318 | FunctionExpression *asFunctionDefinition() override; | - | ||||||||||||||||||
319 | ClassExpression *asClassDefinition() override; | - | ||||||||||||||||||
320 | - | |||||||||||||||||||
321 | - | |||||||||||||||||||
322 | // attributes | - | ||||||||||||||||||
323 | ExpressionNode *expression; | - | ||||||||||||||||||
324 | SourceLocation lparenToken; | - | ||||||||||||||||||
325 | SourceLocation rparenToken; | - | ||||||||||||||||||
326 | }; | - | ||||||||||||||||||
327 | - | |||||||||||||||||||
328 | class QML_PARSER_EXPORT ThisExpression: public LeftHandSideExpression | - | ||||||||||||||||||
329 | { | - | ||||||||||||||||||
330 | public: | - | ||||||||||||||||||
331 | QQMLJS_DECLARE_AST_NODE(ThisExpression) | - | ||||||||||||||||||
332 | - | |||||||||||||||||||
333 | ThisExpression() { kind = K; } executed 196756 times by 17 tests: end of block Executed by:
| 196756 | ||||||||||||||||||
334 | - | |||||||||||||||||||
335 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
336 | - | |||||||||||||||||||
337 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
338 | { return thisToken; } executed 278112 times by 12 tests: return thisToken; Executed by:
| 278112 | ||||||||||||||||||
339 | - | |||||||||||||||||||
340 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
341 | { return thisToken; } executed 29361 times by 5 tests: return thisToken; Executed by:
| 29361 | ||||||||||||||||||
342 | - | |||||||||||||||||||
343 | // attributes | - | ||||||||||||||||||
344 | SourceLocation thisToken; | - | ||||||||||||||||||
345 | }; | - | ||||||||||||||||||
346 | - | |||||||||||||||||||
347 | class QML_PARSER_EXPORT IdentifierExpression: public LeftHandSideExpression | - | ||||||||||||||||||
348 | { | - | ||||||||||||||||||
349 | public: | - | ||||||||||||||||||
350 | QQMLJS_DECLARE_AST_NODE(IdentifierExpression) | - | ||||||||||||||||||
351 | - | |||||||||||||||||||
352 | IdentifierExpression(const QStringRef &n): | - | ||||||||||||||||||
353 | name (n) { kind = K; } executed 13199313 times by 148 tests: end of block Executed by:
| 13199313 | ||||||||||||||||||
354 | - | |||||||||||||||||||
355 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
356 | - | |||||||||||||||||||
357 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
358 | { return identifierToken; } executed 18395421 times by 139 tests: return identifierToken; Executed by:
| 18395421 | ||||||||||||||||||
359 | - | |||||||||||||||||||
360 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
361 | { return identifierToken; } executed 4733959 times by 130 tests: return identifierToken; Executed by:
| 4733959 | ||||||||||||||||||
362 | - | |||||||||||||||||||
363 | // attributes | - | ||||||||||||||||||
364 | QStringRef name; | - | ||||||||||||||||||
365 | SourceLocation identifierToken; | - | ||||||||||||||||||
366 | }; | - | ||||||||||||||||||
367 | - | |||||||||||||||||||
368 | class QML_PARSER_EXPORT NullExpression: public LeftHandSideExpression | - | ||||||||||||||||||
369 | { | - | ||||||||||||||||||
370 | public: | - | ||||||||||||||||||
371 | QQMLJS_DECLARE_AST_NODE(NullExpression) | - | ||||||||||||||||||
372 | - | |||||||||||||||||||
373 | NullExpression() { kind = K; } executed 123125 times by 36 tests: end of block Executed by:
| 123125 | ||||||||||||||||||
374 | - | |||||||||||||||||||
375 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
376 | - | |||||||||||||||||||
377 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
378 | { return nullToken; } executed 34933 times by 10 tests: return nullToken; Executed by:
| 34933 | ||||||||||||||||||
379 | - | |||||||||||||||||||
380 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
381 | { return nullToken; } executed 72167 times by 19 tests: return nullToken; Executed by:
| 72167 | ||||||||||||||||||
382 | - | |||||||||||||||||||
383 | // attributes | - | ||||||||||||||||||
384 | SourceLocation nullToken; | - | ||||||||||||||||||
385 | }; | - | ||||||||||||||||||
386 | - | |||||||||||||||||||
387 | class QML_PARSER_EXPORT TrueLiteral: public LeftHandSideExpression | - | ||||||||||||||||||
388 | { | - | ||||||||||||||||||
389 | public: | - | ||||||||||||||||||
390 | QQMLJS_DECLARE_AST_NODE(TrueLiteral) | - | ||||||||||||||||||
391 | - | |||||||||||||||||||
392 | TrueLiteral() { kind = K; } executed 201227 times by 96 tests: end of block Executed by:
| 201227 | ||||||||||||||||||
393 | - | |||||||||||||||||||
394 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
395 | - | |||||||||||||||||||
396 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
397 | { return trueToken; } executed 87074 times by 86 tests: return trueToken; Executed by:
| 87074 | ||||||||||||||||||
398 | - | |||||||||||||||||||
399 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
400 | { return trueToken; } executed 234302 times by 29 tests: return trueToken; Executed by:
| 234302 | ||||||||||||||||||
401 | - | |||||||||||||||||||
402 | // attributes | - | ||||||||||||||||||
403 | SourceLocation trueToken; | - | ||||||||||||||||||
404 | }; | - | ||||||||||||||||||
405 | - | |||||||||||||||||||
406 | class QML_PARSER_EXPORT FalseLiteral: public LeftHandSideExpression | - | ||||||||||||||||||
407 | { | - | ||||||||||||||||||
408 | public: | - | ||||||||||||||||||
409 | QQMLJS_DECLARE_AST_NODE(FalseLiteral) | - | ||||||||||||||||||
410 | - | |||||||||||||||||||
411 | FalseLiteral() { kind = K; } executed 74127 times by 85 tests: end of block Executed by:
| 74127 | ||||||||||||||||||
412 | - | |||||||||||||||||||
413 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
414 | - | |||||||||||||||||||
415 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
416 | { return falseToken; } executed 66156 times by 78 tests: return falseToken; Executed by:
| 66156 | ||||||||||||||||||
417 | - | |||||||||||||||||||
418 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
419 | { return falseToken; } executed 175533 times by 21 tests: return falseToken; Executed by:
| 175533 | ||||||||||||||||||
420 | - | |||||||||||||||||||
421 | // attributes | - | ||||||||||||||||||
422 | SourceLocation falseToken; | - | ||||||||||||||||||
423 | }; | - | ||||||||||||||||||
424 | - | |||||||||||||||||||
425 | class QML_PARSER_EXPORT SuperLiteral : public LeftHandSideExpression | - | ||||||||||||||||||
426 | { | - | ||||||||||||||||||
427 | public: | - | ||||||||||||||||||
428 | QQMLJS_DECLARE_AST_NODE(SuperLiteral) | - | ||||||||||||||||||
429 | - | |||||||||||||||||||
430 | SuperLiteral() { kind = K; } executed 1550 times by 3 tests: end of block Executed by:
| 1550 | ||||||||||||||||||
431 | - | |||||||||||||||||||
432 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
433 | - | |||||||||||||||||||
434 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
435 | { return superToken; } executed 6235 times by 2 tests: return superToken; Executed by:
| 6235 | ||||||||||||||||||
436 | - | |||||||||||||||||||
437 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
438 | { return superToken; } executed 920 times by 1 test: return superToken; Executed by:
| 920 | ||||||||||||||||||
439 | - | |||||||||||||||||||
440 | // attributes | - | ||||||||||||||||||
441 | SourceLocation superToken; | - | ||||||||||||||||||
442 | }; | - | ||||||||||||||||||
443 | - | |||||||||||||||||||
444 | - | |||||||||||||||||||
445 | class QML_PARSER_EXPORT NumericLiteral: public LeftHandSideExpression | - | ||||||||||||||||||
446 | { | - | ||||||||||||||||||
447 | public: | - | ||||||||||||||||||
448 | QQMLJS_DECLARE_AST_NODE(NumericLiteral) | - | ||||||||||||||||||
449 | - | |||||||||||||||||||
450 | NumericLiteral(double v): | - | ||||||||||||||||||
451 | value(v) { kind = K; } executed 1587558 times by 134 tests: end of block Executed by:
| 1587558 | ||||||||||||||||||
452 | - | |||||||||||||||||||
453 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
454 | - | |||||||||||||||||||
455 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
456 | { return literalToken; } executed 1546610 times by 124 tests: return literalToken; Executed by:
| 1546610 | ||||||||||||||||||
457 | - | |||||||||||||||||||
458 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
459 | { return literalToken; } executed 2787219 times by 57 tests: return literalToken; Executed by:
| 2787219 | ||||||||||||||||||
460 | - | |||||||||||||||||||
461 | // attributes: | - | ||||||||||||||||||
462 | double value; | - | ||||||||||||||||||
463 | SourceLocation literalToken; | - | ||||||||||||||||||
464 | }; | - | ||||||||||||||||||
465 | - | |||||||||||||||||||
466 | class QML_PARSER_EXPORT StringLiteral: public LeftHandSideExpression | - | ||||||||||||||||||
467 | { | - | ||||||||||||||||||
468 | public: | - | ||||||||||||||||||
469 | QQMLJS_DECLARE_AST_NODE(StringLiteral) | - | ||||||||||||||||||
470 | - | |||||||||||||||||||
471 | StringLiteral(const QStringRef &v): | - | ||||||||||||||||||
472 | value (v) { kind = K; } executed 3736284 times by 138 tests: end of block Executed by:
| 3736284 | ||||||||||||||||||
473 | - | |||||||||||||||||||
474 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
475 | - | |||||||||||||||||||
476 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
477 | { return literalToken; } executed 1563651 times by 125 tests: return literalToken; Executed by:
| 1563651 | ||||||||||||||||||
478 | - | |||||||||||||||||||
479 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
480 | { return literalToken; } executed 1914033 times by 40 tests: return literalToken; Executed by:
| 1914033 | ||||||||||||||||||
481 | - | |||||||||||||||||||
482 | // attributes: | - | ||||||||||||||||||
483 | QStringRef value; | - | ||||||||||||||||||
484 | SourceLocation literalToken; | - | ||||||||||||||||||
485 | }; | - | ||||||||||||||||||
486 | - | |||||||||||||||||||
487 | class QML_PARSER_EXPORT TemplateLiteral : public LeftHandSideExpression | - | ||||||||||||||||||
488 | { | - | ||||||||||||||||||
489 | public: | - | ||||||||||||||||||
490 | QQMLJS_DECLARE_AST_NODE(TemplateLiteral) | - | ||||||||||||||||||
491 | - | |||||||||||||||||||
492 | TemplateLiteral(const QStringRef &str, ExpressionNode *e) | - | ||||||||||||||||||
493 | : value(str), expression(e), next(nullptr) | - | ||||||||||||||||||
494 | { kind = K; } executed 2248 times by 3 tests: end of block Executed by:
| 2248 | ||||||||||||||||||
495 | - | |||||||||||||||||||
496 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
497 | { return literalToken; } executed 2702 times by 2 tests: return literalToken; Executed by:
| 2702 | ||||||||||||||||||
498 | - | |||||||||||||||||||
499 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
500 | { return next ? next->lastSourceLocation() : (expression ? expression->lastSourceLocation() : literalToken); } executed 5948 times by 2 tests: return next ? next->lastSourceLocation() : (expression ? expression->lastSourceLocation() : literalToken); Executed by:
| 5948 | ||||||||||||||||||
501 | - | |||||||||||||||||||
502 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
503 | - | |||||||||||||||||||
504 | QStringRef value; | - | ||||||||||||||||||
505 | ExpressionNode *expression; | - | ||||||||||||||||||
506 | TemplateLiteral *next; | - | ||||||||||||||||||
507 | SourceLocation literalToken; | - | ||||||||||||||||||
508 | }; | - | ||||||||||||||||||
509 | - | |||||||||||||||||||
510 | class QML_PARSER_EXPORT RegExpLiteral: public LeftHandSideExpression | - | ||||||||||||||||||
511 | { | - | ||||||||||||||||||
512 | public: | - | ||||||||||||||||||
513 | QQMLJS_DECLARE_AST_NODE(RegExpLiteral) | - | ||||||||||||||||||
514 | - | |||||||||||||||||||
515 | RegExpLiteral(const QStringRef &p, int f): | - | ||||||||||||||||||
516 | pattern (p), flags (f) { kind = K; } executed 1062556 times by 9 tests: end of block Executed by:
| 1062556 | ||||||||||||||||||
517 | - | |||||||||||||||||||
518 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
519 | - | |||||||||||||||||||
520 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
521 | { return literalToken; } executed 4221636 times by 8 tests: return literalToken; Executed by:
| 4221636 | ||||||||||||||||||
522 | - | |||||||||||||||||||
523 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
524 | { return literalToken; } executed 1077379 times by 7 tests: return literalToken; Executed by:
| 1077379 | ||||||||||||||||||
525 | - | |||||||||||||||||||
526 | // attributes: | - | ||||||||||||||||||
527 | QStringRef pattern; | - | ||||||||||||||||||
528 | int flags; | - | ||||||||||||||||||
529 | SourceLocation literalToken; | - | ||||||||||||||||||
530 | }; | - | ||||||||||||||||||
531 | - | |||||||||||||||||||
532 | class QML_PARSER_EXPORT Pattern : public LeftHandSideExpression | - | ||||||||||||||||||
533 | { | - | ||||||||||||||||||
534 | public: | - | ||||||||||||||||||
535 | enum ParseMode { | - | ||||||||||||||||||
536 | Literal, | - | ||||||||||||||||||
537 | Binding | - | ||||||||||||||||||
538 | }; | - | ||||||||||||||||||
539 | Pattern *patternCast() override; | - | ||||||||||||||||||
540 | virtual bool convertLiteralToAssignmentPattern(MemoryPool *pool, SourceLocation *errorLocation, QString *errorMessage) = 0; | - | ||||||||||||||||||
541 | ParseMode parseMode = Literal; | - | ||||||||||||||||||
542 | }; | - | ||||||||||||||||||
543 | - | |||||||||||||||||||
544 | class QML_PARSER_EXPORT ArrayPattern : public Pattern | - | ||||||||||||||||||
545 | { | - | ||||||||||||||||||
546 | public: | - | ||||||||||||||||||
547 | QQMLJS_DECLARE_AST_NODE(ArrayPattern) | - | ||||||||||||||||||
548 | - | |||||||||||||||||||
549 | ArrayPattern(PatternElementList *elts) | - | ||||||||||||||||||
550 | : elements(elts) | - | ||||||||||||||||||
551 | { kind = K; } executed 118459 times by 47 tests: end of block Executed by:
| 118459 | ||||||||||||||||||
552 | - | |||||||||||||||||||
553 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
554 | - | |||||||||||||||||||
555 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
556 | { return lbracketToken; } executed 156665 times by 33 tests: return lbracketToken; Executed by:
| 156665 | ||||||||||||||||||
557 | - | |||||||||||||||||||
558 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
559 | { return rbracketToken; } executed 205871 times by 36 tests: return rbracketToken; Executed by:
| 205871 | ||||||||||||||||||
560 | - | |||||||||||||||||||
561 | bool isValidArrayLiteral(SourceLocation *errorLocation = nullptr) const; | - | ||||||||||||||||||
562 | - | |||||||||||||||||||
563 | bool convertLiteralToAssignmentPattern(MemoryPool *pool, SourceLocation *errorLocation, QString *errorMessage) override; | - | ||||||||||||||||||
564 | - | |||||||||||||||||||
565 | // attributes | - | ||||||||||||||||||
566 | PatternElementList *elements = nullptr; | - | ||||||||||||||||||
567 | SourceLocation lbracketToken; | - | ||||||||||||||||||
568 | SourceLocation commaToken; | - | ||||||||||||||||||
569 | SourceLocation rbracketToken; | - | ||||||||||||||||||
570 | }; | - | ||||||||||||||||||
571 | - | |||||||||||||||||||
572 | class QML_PARSER_EXPORT ObjectPattern : public Pattern | - | ||||||||||||||||||
573 | { | - | ||||||||||||||||||
574 | public: | - | ||||||||||||||||||
575 | QQMLJS_DECLARE_AST_NODE(ObjectPattern) | - | ||||||||||||||||||
576 | - | |||||||||||||||||||
577 | ObjectPattern() | - | ||||||||||||||||||
578 | { kind = K; } executed 37889 times by 17 tests: end of block Executed by:
| 37889 | ||||||||||||||||||
579 | - | |||||||||||||||||||
580 | ObjectPattern(PatternPropertyList *plist) | - | ||||||||||||||||||
581 | : properties(plist) | - | ||||||||||||||||||
582 | { kind = K; } executed 96855 times by 34 tests: end of block Executed by:
| 96855 | ||||||||||||||||||
583 | - | |||||||||||||||||||
584 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
585 | - | |||||||||||||||||||
586 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
587 | { return lbraceToken; } executed 164878 times by 8 tests: return lbraceToken; Executed by:
| 164878 | ||||||||||||||||||
588 | - | |||||||||||||||||||
589 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
590 | { return rbraceToken; } executed 356509 times by 12 tests: return rbraceToken; Executed by:
| 356509 | ||||||||||||||||||
591 | - | |||||||||||||||||||
592 | bool convertLiteralToAssignmentPattern(MemoryPool *pool, SourceLocation *errorLocation, QString *errorMessage) override; | - | ||||||||||||||||||
593 | - | |||||||||||||||||||
594 | // attributes | - | ||||||||||||||||||
595 | PatternPropertyList *properties = nullptr; | - | ||||||||||||||||||
596 | SourceLocation lbraceToken; | - | ||||||||||||||||||
597 | SourceLocation rbraceToken; | - | ||||||||||||||||||
598 | }; | - | ||||||||||||||||||
599 | - | |||||||||||||||||||
600 | class QML_PARSER_EXPORT Elision: public Node | - | ||||||||||||||||||
601 | { | - | ||||||||||||||||||
602 | public: | - | ||||||||||||||||||
603 | QQMLJS_DECLARE_AST_NODE(Elision) | - | ||||||||||||||||||
604 | - | |||||||||||||||||||
605 | Elision(): | - | ||||||||||||||||||
606 | next (this) { kind = K; } executed 4035 times by 4 tests: end of block Executed by:
| 4035 | ||||||||||||||||||
607 | - | |||||||||||||||||||
608 | Elision(Elision *previous) | - | ||||||||||||||||||
609 | { | - | ||||||||||||||||||
610 | kind = K; | - | ||||||||||||||||||
611 | next = previous->next; | - | ||||||||||||||||||
612 | previous->next = this; | - | ||||||||||||||||||
613 | } executed 1148 times by 2 tests: end of block Executed by:
| 1148 | ||||||||||||||||||
614 | - | |||||||||||||||||||
615 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
616 | - | |||||||||||||||||||
617 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
618 | { return commaToken; } executed 7030 times by 1 test: return commaToken; Executed by:
| 7030 | ||||||||||||||||||
619 | - | |||||||||||||||||||
620 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
621 | { return next ? next->lastSourceLocation() : commaToken; } executed 6492 times by 1 test: return next ? next->lastSourceLocation() : commaToken; Executed by:
| 6492 | ||||||||||||||||||
622 | - | |||||||||||||||||||
623 | inline Elision *finish () | - | ||||||||||||||||||
624 | { | - | ||||||||||||||||||
625 | Elision *front = next; | - | ||||||||||||||||||
626 | next = nullptr; | - | ||||||||||||||||||
627 | return front; executed 4034 times by 4 tests: return front; Executed by:
| 4034 | ||||||||||||||||||
628 | } | - | ||||||||||||||||||
629 | - | |||||||||||||||||||
630 | // attributes | - | ||||||||||||||||||
631 | Elision *next; | - | ||||||||||||||||||
632 | SourceLocation commaToken; | - | ||||||||||||||||||
633 | }; | - | ||||||||||||||||||
634 | - | |||||||||||||||||||
635 | class QML_PARSER_EXPORT PropertyName: public Node | - | ||||||||||||||||||
636 | { | - | ||||||||||||||||||
637 | public: | - | ||||||||||||||||||
638 | QQMLJS_DECLARE_AST_NODE(PropertyName) | - | ||||||||||||||||||
639 | - | |||||||||||||||||||
640 | PropertyName() { kind = K; } executed 188274 times by 34 tests: end of block Executed by:
| 188274 | ||||||||||||||||||
641 | - | |||||||||||||||||||
642 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
643 | { return propertyNameToken; } executed 583678 times by 2 tests: return propertyNameToken; Executed by:
| 583678 | ||||||||||||||||||
644 | - | |||||||||||||||||||
645 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
646 | { return propertyNameToken; } executed 138482 times by 1 test: return propertyNameToken; Executed by:
| 138482 | ||||||||||||||||||
647 | - | |||||||||||||||||||
648 | virtual QString asString() const = 0; | - | ||||||||||||||||||
649 | - | |||||||||||||||||||
650 | // attributes | - | ||||||||||||||||||
651 | SourceLocation propertyNameToken; | - | ||||||||||||||||||
652 | }; | - | ||||||||||||||||||
653 | - | |||||||||||||||||||
654 | class QML_PARSER_EXPORT PatternElement : public Node | - | ||||||||||||||||||
655 | { | - | ||||||||||||||||||
656 | public: | - | ||||||||||||||||||
657 | QQMLJS_DECLARE_AST_NODE(PatternElement) | - | ||||||||||||||||||
658 | - | |||||||||||||||||||
659 | enum Type { | - | ||||||||||||||||||
660 | // object literal types | - | ||||||||||||||||||
661 | Literal, | - | ||||||||||||||||||
662 | Getter, | - | ||||||||||||||||||
663 | Setter, | - | ||||||||||||||||||
664 | - | |||||||||||||||||||
665 | // used by both bindings and literals | - | ||||||||||||||||||
666 | SpreadElement, | - | ||||||||||||||||||
667 | RestElement = SpreadElement, | - | ||||||||||||||||||
668 | - | |||||||||||||||||||
669 | // binding types | - | ||||||||||||||||||
670 | Binding, | - | ||||||||||||||||||
671 | }; | - | ||||||||||||||||||
672 | - | |||||||||||||||||||
673 | PatternElement(ExpressionNode *i = nullptr, Type t = Literal) | - | ||||||||||||||||||
674 | : initializer(i), type(t) | - | ||||||||||||||||||
675 | { kind = K; } executed 444933 times by 49 tests: end of block Executed by:
| 444933 | ||||||||||||||||||
676 | - | |||||||||||||||||||
677 | PatternElement(const QStringRef &n, ExpressionNode *i = nullptr, Type t = Binding) | - | ||||||||||||||||||
678 | : bindingIdentifier(n), initializer(i), type(t) | - | ||||||||||||||||||
679 | { | - | ||||||||||||||||||
680 | Q_ASSERT(t >= RestElement); | - | ||||||||||||||||||
681 | kind = K; | - | ||||||||||||||||||
682 | } executed 2735448 times by 72 tests: end of block Executed by:
| 2735448 | ||||||||||||||||||
683 | - | |||||||||||||||||||
684 | PatternElement(Pattern *pattern, ExpressionNode *i = nullptr, Type t = Binding) | - | ||||||||||||||||||
685 | : bindingTarget(pattern), initializer(i), type(t) | - | ||||||||||||||||||
686 | { | - | ||||||||||||||||||
687 | Q_ASSERT(t >= RestElement); | - | ||||||||||||||||||
688 | kind = K; | - | ||||||||||||||||||
689 | } executed 31814 times by 2 tests: end of block Executed by:
| 31814 | ||||||||||||||||||
690 | - | |||||||||||||||||||
691 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
692 | virtual bool convertLiteralToAssignmentPattern(MemoryPool *pool, SourceLocation *errorLocation, QString *errorMessage); | - | ||||||||||||||||||
693 | - | |||||||||||||||||||
694 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
695 | { return identifierToken.isValid() ? identifierToken : (bindingTarget ? bindingTarget->firstSourceLocation() : initializer->firstSourceLocation()); } executed 1268350 times by 2 tests: return identifierToken.isValid() ? identifierToken : (bindingTarget ? bindingTarget->firstSourceLocation() : initializer->firstSourceLocation()); Executed by:
| 1268350 | ||||||||||||||||||
696 | - | |||||||||||||||||||
697 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
698 | { return initializer ? initializer->lastSourceLocation() : (bindingTarget ? bindingTarget->lastSourceLocation() : identifierToken); } executed 2039482 times by 9 tests: return initializer ? initializer->lastSourceLocation() : (bindingTarget ? bindingTarget->lastSourceLocation() : identifierToken); Executed by:
| 2039482 | ||||||||||||||||||
699 | - | |||||||||||||||||||
700 | ExpressionNode *destructuringTarget() const { return bindingTarget; } never executed: return bindingTarget; | 0 | ||||||||||||||||||
701 | Pattern *destructuringPattern() const { return bindingTarget ? bindingTarget->patternCast() : nullptr; } executed 503432 times by 50 tests: return bindingTarget ? bindingTarget->patternCast() : nullptr; Executed by:
| 503432 | ||||||||||||||||||
702 | PatternElementList *elementList() const { ArrayPattern *a = cast<ArrayPattern *>(bindingTarget); return a ? a->elements : nullptr; } executed 36528 times by 1 test: return a ? a->elements : nullptr; Executed by:
| 36528 | ||||||||||||||||||
703 | PatternPropertyList *propertyList() const { ObjectPattern *o = cast<ObjectPattern *>(bindingTarget); return o ? o->properties : nullptr; } executed 15364 times by 1 test: return o ? o->properties : nullptr; Executed by:
| 15364 | ||||||||||||||||||
704 | - | |||||||||||||||||||
705 | bool isVariableDeclaration() const { return scope != VariableScope::NoScope; } never executed: return scope != VariableScope::NoScope; | 0 | ||||||||||||||||||
706 | bool isLexicallyScoped() const { return scope == VariableScope::Let || scope == VariableScope::Const; } never executed: return scope == VariableScope::Let || scope == VariableScope::Const; | 0 | ||||||||||||||||||
707 | - | |||||||||||||||||||
708 | virtual void boundNames(QStringList *names); | - | ||||||||||||||||||
709 | - | |||||||||||||||||||
710 | // attributes | - | ||||||||||||||||||
711 | SourceLocation identifierToken; | - | ||||||||||||||||||
712 | QStringRef bindingIdentifier; | - | ||||||||||||||||||
713 | ExpressionNode *bindingTarget = nullptr; | - | ||||||||||||||||||
714 | ExpressionNode *initializer = nullptr; | - | ||||||||||||||||||
715 | Type type = Literal; | - | ||||||||||||||||||
716 | // when used in a VariableDeclarationList | - | ||||||||||||||||||
717 | VariableScope scope = VariableScope::NoScope; | - | ||||||||||||||||||
718 | }; | - | ||||||||||||||||||
719 | - | |||||||||||||||||||
720 | class QML_PARSER_EXPORT PatternElementList : public Node | - | ||||||||||||||||||
721 | { | - | ||||||||||||||||||
722 | public: | - | ||||||||||||||||||
723 | QQMLJS_DECLARE_AST_NODE(PatternElementList) | - | ||||||||||||||||||
724 | - | |||||||||||||||||||
725 | PatternElementList(Elision *elision, PatternElement *element) | - | ||||||||||||||||||
726 | : elision(elision), element(element), next(this) | - | ||||||||||||||||||
727 | { kind = K; } executed 304392 times by 41 tests: end of block Executed by:
| 304392 | ||||||||||||||||||
728 | - | |||||||||||||||||||
729 | PatternElementList *append(PatternElementList *n) { | - | ||||||||||||||||||
730 | n->next = next; | - | ||||||||||||||||||
731 | next = n; | - | ||||||||||||||||||
732 | return n; executed 212740 times by 38 tests: return n; Executed by:
| 212740 | ||||||||||||||||||
733 | } | - | ||||||||||||||||||
734 | - | |||||||||||||||||||
735 | inline PatternElementList *finish () | - | ||||||||||||||||||
736 | { | - | ||||||||||||||||||
737 | PatternElementList *front = next; | - | ||||||||||||||||||
738 | next = 0; | - | ||||||||||||||||||
739 | return front; executed 91669 times by 41 tests: return front; Executed by:
| 91669 | ||||||||||||||||||
740 | } | - | ||||||||||||||||||
741 | - | |||||||||||||||||||
742 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
743 | - | |||||||||||||||||||
744 | void boundNames(QStringList *names); | - | ||||||||||||||||||
745 | - | |||||||||||||||||||
746 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
747 | { return elision ? elision->firstSourceLocation() : element->firstSourceLocation(); } executed 225700 times by 1 test: return elision ? elision->firstSourceLocation() : element->firstSourceLocation(); Executed by:
| 225700 | ||||||||||||||||||
748 | - | |||||||||||||||||||
749 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
750 | { return next ? next->lastSourceLocation() : (element ? element->lastSourceLocation() : elision->lastSourceLocation()); } executed 2072058 times by 1 test: return next ? next->lastSourceLocation() : (element ? element->lastSourceLocation() : elision->lastSourceLocation()); Executed by:
| 2072058 | ||||||||||||||||||
751 | - | |||||||||||||||||||
752 | Elision *elision = nullptr; | - | ||||||||||||||||||
753 | PatternElement *element = nullptr; | - | ||||||||||||||||||
754 | PatternElementList *next; | - | ||||||||||||||||||
755 | }; | - | ||||||||||||||||||
756 | - | |||||||||||||||||||
757 | class QML_PARSER_EXPORT PatternProperty : public PatternElement | - | ||||||||||||||||||
758 | { | - | ||||||||||||||||||
759 | public: | - | ||||||||||||||||||
760 | QQMLJS_DECLARE_AST_NODE(PatternProperty) | - | ||||||||||||||||||
761 | - | |||||||||||||||||||
762 | PatternProperty(PropertyName *name, ExpressionNode *i = nullptr, Type t = Literal) | - | ||||||||||||||||||
763 | : PatternElement(i, t), name(name) | - | ||||||||||||||||||
764 | { kind = K; } executed 166037 times by 34 tests: end of block Executed by:
| 166037 | ||||||||||||||||||
765 | - | |||||||||||||||||||
766 | PatternProperty(PropertyName *name, const QStringRef &n, ExpressionNode *i = nullptr) | - | ||||||||||||||||||
767 | : PatternElement(n, i), name(name) | - | ||||||||||||||||||
768 | { kind = K; } executed 16481 times by 2 tests: end of block Executed by:
| 16481 | ||||||||||||||||||
769 | - | |||||||||||||||||||
770 | PatternProperty(PropertyName *name, Pattern *pattern, ExpressionNode *i = nullptr) | - | ||||||||||||||||||
771 | : PatternElement(pattern, i), name(name) | - | ||||||||||||||||||
772 | { kind = K; } executed 2082 times by 2 tests: end of block Executed by:
| 2082 | ||||||||||||||||||
773 | - | |||||||||||||||||||
774 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
775 | - | |||||||||||||||||||
776 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
777 | { return name->firstSourceLocation(); } executed 449102 times by 2 tests: return name->firstSourceLocation(); Executed by:
| 449102 | ||||||||||||||||||
778 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
779 | { | - | ||||||||||||||||||
780 | SourceLocation loc = PatternElement::lastSourceLocation(); | - | ||||||||||||||||||
781 | return loc.isValid() ? loc : name->lastSourceLocation(); executed 449046 times by 1 test: return loc.isValid() ? loc : name->lastSourceLocation(); Executed by:
| 449046 | ||||||||||||||||||
782 | } | - | ||||||||||||||||||
783 | - | |||||||||||||||||||
784 | void boundNames(QStringList *names) override; | - | ||||||||||||||||||
785 | bool convertLiteralToAssignmentPattern(MemoryPool *pool, SourceLocation *errorLocation, QString *errorMessage) override; | - | ||||||||||||||||||
786 | - | |||||||||||||||||||
787 | // attributes | - | ||||||||||||||||||
788 | PropertyName *name; | - | ||||||||||||||||||
789 | SourceLocation colonToken; | - | ||||||||||||||||||
790 | }; | - | ||||||||||||||||||
791 | - | |||||||||||||||||||
792 | - | |||||||||||||||||||
793 | class QML_PARSER_EXPORT PatternPropertyList : public Node | - | ||||||||||||||||||
794 | { | - | ||||||||||||||||||
795 | public: | - | ||||||||||||||||||
796 | QQMLJS_DECLARE_AST_NODE(PatternPropertyList) | - | ||||||||||||||||||
797 | - | |||||||||||||||||||
798 | PatternPropertyList(PatternProperty *property) | - | ||||||||||||||||||
799 | : property(property), next(this) | - | ||||||||||||||||||
800 | { kind = K; } executed 95882 times by 34 tests: end of block Executed by:
| 95882 | ||||||||||||||||||
801 | - | |||||||||||||||||||
802 | PatternPropertyList(PatternPropertyList *previous, PatternProperty *property) | - | ||||||||||||||||||
803 | : property(property), next(this) | - | ||||||||||||||||||
804 | { | - | ||||||||||||||||||
805 | kind = K; | - | ||||||||||||||||||
806 | next = previous->next; | - | ||||||||||||||||||
807 | previous->next = this; | - | ||||||||||||||||||
808 | } executed 74161 times by 25 tests: end of block Executed by:
| 74161 | ||||||||||||||||||
809 | - | |||||||||||||||||||
810 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
811 | - | |||||||||||||||||||
812 | void boundNames(QStringList *names); | - | ||||||||||||||||||
813 | - | |||||||||||||||||||
814 | inline PatternPropertyList *finish () | - | ||||||||||||||||||
815 | { | - | ||||||||||||||||||
816 | PatternPropertyList *front = next; | - | ||||||||||||||||||
817 | next = 0; | - | ||||||||||||||||||
818 | return front; executed 95783 times by 34 tests: return front; Executed by:
| 95783 | ||||||||||||||||||
819 | } | - | ||||||||||||||||||
820 | - | |||||||||||||||||||
821 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
822 | { return property->firstSourceLocation(); } executed 195000 times by 1 test: return property->firstSourceLocation(); Executed by:
| 195000 | ||||||||||||||||||
823 | - | |||||||||||||||||||
824 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
825 | { return next ? next->lastSourceLocation() : property->lastSourceLocation(); } executed 809560 times by 1 test: return next ? next->lastSourceLocation() : property->lastSourceLocation(); Executed by:
| 809560 | ||||||||||||||||||
826 | - | |||||||||||||||||||
827 | PatternProperty *property; | - | ||||||||||||||||||
828 | PatternPropertyList *next; | - | ||||||||||||||||||
829 | }; | - | ||||||||||||||||||
830 | - | |||||||||||||||||||
831 | class QML_PARSER_EXPORT IdentifierPropertyName : public PropertyName | - | ||||||||||||||||||
832 | { | - | ||||||||||||||||||
833 | public: | - | ||||||||||||||||||
834 | QQMLJS_DECLARE_AST_NODE(IdentifierPropertyName) | - | ||||||||||||||||||
835 | - | |||||||||||||||||||
836 | IdentifierPropertyName(const QStringRef &n): | - | ||||||||||||||||||
837 | id (n) { kind = K; } executed 152440 times by 22 tests: end of block Executed by:
| 152440 | ||||||||||||||||||
838 | - | |||||||||||||||||||
839 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
840 | - | |||||||||||||||||||
841 | QString asString() const override { return id.toString(); } executed 115562 times by 22 tests: return id.toString(); Executed by:
| 115562 | ||||||||||||||||||
842 | - | |||||||||||||||||||
843 | // attributes | - | ||||||||||||||||||
844 | QStringRef id; | - | ||||||||||||||||||
845 | }; | - | ||||||||||||||||||
846 | - | |||||||||||||||||||
847 | class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName | - | ||||||||||||||||||
848 | { | - | ||||||||||||||||||
849 | public: | - | ||||||||||||||||||
850 | QQMLJS_DECLARE_AST_NODE(StringLiteralPropertyName) | - | ||||||||||||||||||
851 | - | |||||||||||||||||||
852 | StringLiteralPropertyName(const QStringRef &n): | - | ||||||||||||||||||
853 | id (n) { kind = K; } executed 23057 times by 21 tests: end of block Executed by:
| 23057 | ||||||||||||||||||
854 | - | |||||||||||||||||||
855 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
856 | - | |||||||||||||||||||
857 | QString asString() const override { return id.toString(); } executed 15156 times by 21 tests: return id.toString(); Executed by:
| 15156 | ||||||||||||||||||
858 | - | |||||||||||||||||||
859 | // attributes | - | ||||||||||||||||||
860 | QStringRef id; | - | ||||||||||||||||||
861 | }; | - | ||||||||||||||||||
862 | - | |||||||||||||||||||
863 | class QML_PARSER_EXPORT NumericLiteralPropertyName: public PropertyName | - | ||||||||||||||||||
864 | { | - | ||||||||||||||||||
865 | public: | - | ||||||||||||||||||
866 | QQMLJS_DECLARE_AST_NODE(NumericLiteralPropertyName) | - | ||||||||||||||||||
867 | - | |||||||||||||||||||
868 | NumericLiteralPropertyName(double n): | - | ||||||||||||||||||
869 | id (n) { kind = K; } executed 8479 times by 3 tests: end of block Executed by:
| 8479 | ||||||||||||||||||
870 | - | |||||||||||||||||||
871 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
872 | - | |||||||||||||||||||
873 | QString asString() const override { return QString::number(id, 'g', 16); } executed 8028 times by 2 tests: return QString::number(id, 'g', 16); Executed by:
| 8028 | ||||||||||||||||||
874 | - | |||||||||||||||||||
875 | // attributes | - | ||||||||||||||||||
876 | double id; | - | ||||||||||||||||||
877 | }; | - | ||||||||||||||||||
878 | - | |||||||||||||||||||
879 | class QML_PARSER_EXPORT ComputedPropertyName : public PropertyName | - | ||||||||||||||||||
880 | { | - | ||||||||||||||||||
881 | public: | - | ||||||||||||||||||
882 | QQMLJS_DECLARE_AST_NODE(ComputedPropertyName) | - | ||||||||||||||||||
883 | - | |||||||||||||||||||
884 | ComputedPropertyName(ExpressionNode *expression) | - | ||||||||||||||||||
885 | : expression(expression) | - | ||||||||||||||||||
886 | { kind = K; } executed 4165 times by 2 tests: end of block Executed by:
| 4165 | ||||||||||||||||||
887 | - | |||||||||||||||||||
888 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
889 | - | |||||||||||||||||||
890 | QString asString() const override { return QString(); } executed 543 times by 1 test: return QString(); Executed by:
| 543 | ||||||||||||||||||
891 | - | |||||||||||||||||||
892 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
893 | { return expression->firstSourceLocation(); } executed 12133 times by 2 tests: return expression->firstSourceLocation(); Executed by:
| 12133 | ||||||||||||||||||
894 | - | |||||||||||||||||||
895 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
896 | { return expression->lastSourceLocation(); } executed 3036 times by 1 test: return expression->lastSourceLocation(); Executed by:
| 3036 | ||||||||||||||||||
897 | - | |||||||||||||||||||
898 | // attributes | - | ||||||||||||||||||
899 | ExpressionNode *expression; | - | ||||||||||||||||||
900 | }; | - | ||||||||||||||||||
901 | - | |||||||||||||||||||
902 | - | |||||||||||||||||||
903 | class QML_PARSER_EXPORT ArrayMemberExpression: public LeftHandSideExpression | - | ||||||||||||||||||
904 | { | - | ||||||||||||||||||
905 | public: | - | ||||||||||||||||||
906 | QQMLJS_DECLARE_AST_NODE(ArrayMemberExpression) | - | ||||||||||||||||||
907 | - | |||||||||||||||||||
908 | ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e): | - | ||||||||||||||||||
909 | base (b), expression (e) | - | ||||||||||||||||||
910 | { kind = K; } executed 161899 times by 34 tests: end of block Executed by:
| 161899 | ||||||||||||||||||
911 | - | |||||||||||||||||||
912 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
913 | - | |||||||||||||||||||
914 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
915 | { return base->firstSourceLocation(); } executed 365596 times by 20 tests: return base->firstSourceLocation(); Executed by:
| 365596 | ||||||||||||||||||
916 | - | |||||||||||||||||||
917 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
918 | { return rbracketToken; } executed 209308 times by 17 tests: return rbracketToken; Executed by:
| 209308 | ||||||||||||||||||
919 | - | |||||||||||||||||||
920 | // attributes | - | ||||||||||||||||||
921 | ExpressionNode *base; | - | ||||||||||||||||||
922 | ExpressionNode *expression; | - | ||||||||||||||||||
923 | SourceLocation lbracketToken; | - | ||||||||||||||||||
924 | SourceLocation rbracketToken; | - | ||||||||||||||||||
925 | }; | - | ||||||||||||||||||
926 | - | |||||||||||||||||||
927 | class QML_PARSER_EXPORT FieldMemberExpression: public LeftHandSideExpression | - | ||||||||||||||||||
928 | { | - | ||||||||||||||||||
929 | public: | - | ||||||||||||||||||
930 | QQMLJS_DECLARE_AST_NODE(FieldMemberExpression) | - | ||||||||||||||||||
931 | - | |||||||||||||||||||
932 | FieldMemberExpression(ExpressionNode *b, const QStringRef &n): | - | ||||||||||||||||||
933 | base (b), name (n) | - | ||||||||||||||||||
934 | { kind = K; } executed 3209543 times by 139 tests: end of block Executed by:
| 3209543 | ||||||||||||||||||
935 | - | |||||||||||||||||||
936 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
937 | - | |||||||||||||||||||
938 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
939 | { return base->firstSourceLocation(); } executed 6195244 times by 112 tests: return base->firstSourceLocation(); Executed by:
| 6195244 | ||||||||||||||||||
940 | - | |||||||||||||||||||
941 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
942 | { return identifierToken; } executed 2030326 times by 106 tests: return identifierToken; Executed by:
| 2030326 | ||||||||||||||||||
943 | - | |||||||||||||||||||
944 | // attributes | - | ||||||||||||||||||
945 | ExpressionNode *base; | - | ||||||||||||||||||
946 | QStringRef name; | - | ||||||||||||||||||
947 | SourceLocation dotToken; | - | ||||||||||||||||||
948 | SourceLocation identifierToken; | - | ||||||||||||||||||
949 | }; | - | ||||||||||||||||||
950 | - | |||||||||||||||||||
951 | class QML_PARSER_EXPORT TaggedTemplate : public LeftHandSideExpression | - | ||||||||||||||||||
952 | { | - | ||||||||||||||||||
953 | public: | - | ||||||||||||||||||
954 | QQMLJS_DECLARE_AST_NODE(TaggedTemplate) | - | ||||||||||||||||||
955 | - | |||||||||||||||||||
956 | TaggedTemplate(ExpressionNode *b, TemplateLiteral *t) | - | ||||||||||||||||||
957 | : base (b), templateLiteral(t) | - | ||||||||||||||||||
958 | { kind = K; } executed 458 times by 2 tests: end of block Executed by:
| 458 | ||||||||||||||||||
959 | - | |||||||||||||||||||
960 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
961 | - | |||||||||||||||||||
962 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
963 | { return base->firstSourceLocation(); } executed 1573 times by 2 tests: return base->firstSourceLocation(); Executed by:
| 1573 | ||||||||||||||||||
964 | - | |||||||||||||||||||
965 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
966 | { return templateLiteral->lastSourceLocation(); } executed 1050 times by 2 tests: return templateLiteral->lastSourceLocation(); Executed by:
| 1050 | ||||||||||||||||||
967 | - | |||||||||||||||||||
968 | // attributes | - | ||||||||||||||||||
969 | ExpressionNode *base; | - | ||||||||||||||||||
970 | TemplateLiteral *templateLiteral; | - | ||||||||||||||||||
971 | }; | - | ||||||||||||||||||
972 | - | |||||||||||||||||||
973 | class QML_PARSER_EXPORT NewMemberExpression: public LeftHandSideExpression | - | ||||||||||||||||||
974 | { | - | ||||||||||||||||||
975 | public: | - | ||||||||||||||||||
976 | QQMLJS_DECLARE_AST_NODE(NewMemberExpression) | - | ||||||||||||||||||
977 | - | |||||||||||||||||||
978 | NewMemberExpression(ExpressionNode *b, ArgumentList *a): | - | ||||||||||||||||||
979 | base (b), arguments (a) | - | ||||||||||||||||||
980 | { kind = K; } executed 255397 times by 22 tests: end of block Executed by:
| 255397 | ||||||||||||||||||
981 | - | |||||||||||||||||||
982 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
983 | - | |||||||||||||||||||
984 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
985 | { return newToken; } executed 470303 times by 13 tests: return newToken; Executed by:
| 470303 | ||||||||||||||||||
986 | - | |||||||||||||||||||
987 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
988 | { return rparenToken; } executed 431984 times by 12 tests: return rparenToken; Executed by:
| 431984 | ||||||||||||||||||
989 | - | |||||||||||||||||||
990 | // attributes | - | ||||||||||||||||||
991 | ExpressionNode *base; | - | ||||||||||||||||||
992 | ArgumentList *arguments; | - | ||||||||||||||||||
993 | SourceLocation newToken; | - | ||||||||||||||||||
994 | SourceLocation lparenToken; | - | ||||||||||||||||||
995 | SourceLocation rparenToken; | - | ||||||||||||||||||
996 | }; | - | ||||||||||||||||||
997 | - | |||||||||||||||||||
998 | class QML_PARSER_EXPORT NewExpression: public LeftHandSideExpression | - | ||||||||||||||||||
999 | { | - | ||||||||||||||||||
1000 | public: | - | ||||||||||||||||||
1001 | QQMLJS_DECLARE_AST_NODE(NewExpression) | - | ||||||||||||||||||
1002 | - | |||||||||||||||||||
1003 | NewExpression(ExpressionNode *e): | - | ||||||||||||||||||
1004 | expression (e) { kind = K; } executed 1555 times by 11 tests: end of block Executed by:
| 1555 | ||||||||||||||||||
1005 | - | |||||||||||||||||||
1006 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1007 | - | |||||||||||||||||||
1008 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1009 | { return newToken; } executed 2991 times by 3 tests: return newToken; Executed by:
| 2991 | ||||||||||||||||||
1010 | - | |||||||||||||||||||
1011 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1012 | { return expression->lastSourceLocation(); } executed 5976 times by 2 tests: return expression->lastSourceLocation(); Executed by:
| 5976 | ||||||||||||||||||
1013 | - | |||||||||||||||||||
1014 | // attributes | - | ||||||||||||||||||
1015 | ExpressionNode *expression; | - | ||||||||||||||||||
1016 | SourceLocation newToken; | - | ||||||||||||||||||
1017 | }; | - | ||||||||||||||||||
1018 | - | |||||||||||||||||||
1019 | class QML_PARSER_EXPORT CallExpression: public LeftHandSideExpression | - | ||||||||||||||||||
1020 | { | - | ||||||||||||||||||
1021 | public: | - | ||||||||||||||||||
1022 | QQMLJS_DECLARE_AST_NODE(CallExpression) | - | ||||||||||||||||||
1023 | - | |||||||||||||||||||
1024 | CallExpression(ExpressionNode *b, ArgumentList *a): | - | ||||||||||||||||||
1025 | base (b), arguments (a) | - | ||||||||||||||||||
1026 | { kind = K; } executed 3025135 times by 88 tests: end of block Executed by:
| 3025135 | ||||||||||||||||||
1027 | - | |||||||||||||||||||
1028 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1029 | - | |||||||||||||||||||
1030 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1031 | { return base->firstSourceLocation(); } executed 5644026 times by 86 tests: return base->firstSourceLocation(); Executed by:
| 5644026 | ||||||||||||||||||
1032 | - | |||||||||||||||||||
1033 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1034 | { return rparenToken; } executed 3077930 times by 70 tests: return rparenToken; Executed by:
| 3077930 | ||||||||||||||||||
1035 | - | |||||||||||||||||||
1036 | // attributes | - | ||||||||||||||||||
1037 | ExpressionNode *base; | - | ||||||||||||||||||
1038 | ArgumentList *arguments; | - | ||||||||||||||||||
1039 | SourceLocation lparenToken; | - | ||||||||||||||||||
1040 | SourceLocation rparenToken; | - | ||||||||||||||||||
1041 | }; | - | ||||||||||||||||||
1042 | - | |||||||||||||||||||
1043 | class QML_PARSER_EXPORT ArgumentList: public Node | - | ||||||||||||||||||
1044 | { | - | ||||||||||||||||||
1045 | public: | - | ||||||||||||||||||
1046 | QQMLJS_DECLARE_AST_NODE(ArgumentList) | - | ||||||||||||||||||
1047 | - | |||||||||||||||||||
1048 | ArgumentList(ExpressionNode *e): | - | ||||||||||||||||||
1049 | expression (e), next (this) | - | ||||||||||||||||||
1050 | { kind = K; } executed 3053269 times by 78 tests: end of block Executed by:
| 3053269 | ||||||||||||||||||
1051 | - | |||||||||||||||||||
1052 | ArgumentList(ArgumentList *previous, ExpressionNode *e): | - | ||||||||||||||||||
1053 | expression (e) | - | ||||||||||||||||||
1054 | { | - | ||||||||||||||||||
1055 | kind = K; | - | ||||||||||||||||||
1056 | next = previous->next; | - | ||||||||||||||||||
1057 | previous->next = this; | - | ||||||||||||||||||
1058 | } executed 1581773 times by 59 tests: end of block Executed by:
| 1581773 | ||||||||||||||||||
1059 | - | |||||||||||||||||||
1060 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1061 | - | |||||||||||||||||||
1062 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1063 | { return expression->firstSourceLocation(); } executed 1313266 times by 1 test: return expression->firstSourceLocation(); Executed by:
| 1313266 | ||||||||||||||||||
1064 | - | |||||||||||||||||||
1065 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1066 | { | - | ||||||||||||||||||
1067 | if (next)
| 1313266-1708728 | ||||||||||||||||||
1068 | return next->lastSourceLocation(); executed 1708728 times by 1 test: return next->lastSourceLocation(); Executed by:
| 1708728 | ||||||||||||||||||
1069 | return expression->lastSourceLocation(); executed 1313266 times by 1 test: return expression->lastSourceLocation(); Executed by:
| 1313266 | ||||||||||||||||||
1070 | } | - | ||||||||||||||||||
1071 | - | |||||||||||||||||||
1072 | inline ArgumentList *finish () | - | ||||||||||||||||||
1073 | { | - | ||||||||||||||||||
1074 | ArgumentList *front = next; | - | ||||||||||||||||||
1075 | next = nullptr; | - | ||||||||||||||||||
1076 | return front; executed 3055899 times by 78 tests: return front; Executed by:
| 3055899 | ||||||||||||||||||
1077 | } | - | ||||||||||||||||||
1078 | - | |||||||||||||||||||
1079 | // attributes | - | ||||||||||||||||||
1080 | ExpressionNode *expression; | - | ||||||||||||||||||
1081 | ArgumentList *next; | - | ||||||||||||||||||
1082 | SourceLocation commaToken; | - | ||||||||||||||||||
1083 | bool isSpreadElement = false; | - | ||||||||||||||||||
1084 | }; | - | ||||||||||||||||||
1085 | - | |||||||||||||||||||
1086 | class QML_PARSER_EXPORT PostIncrementExpression: public ExpressionNode | - | ||||||||||||||||||
1087 | { | - | ||||||||||||||||||
1088 | public: | - | ||||||||||||||||||
1089 | QQMLJS_DECLARE_AST_NODE(PostIncrementExpression) | - | ||||||||||||||||||
1090 | - | |||||||||||||||||||
1091 | PostIncrementExpression(ExpressionNode *b): | - | ||||||||||||||||||
1092 | base (b) { kind = K; } executed 20701 times by 29 tests: end of block Executed by:
| 20701 | ||||||||||||||||||
1093 | - | |||||||||||||||||||
1094 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1095 | - | |||||||||||||||||||
1096 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1097 | { return base->firstSourceLocation(); } executed 41511 times by 19 tests: return base->firstSourceLocation(); Executed by:
| 41511 | ||||||||||||||||||
1098 | - | |||||||||||||||||||
1099 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1100 | { return incrementToken; } executed 35415 times by 12 tests: return incrementToken; Executed by:
| 35415 | ||||||||||||||||||
1101 | - | |||||||||||||||||||
1102 | // attributes | - | ||||||||||||||||||
1103 | ExpressionNode *base; | - | ||||||||||||||||||
1104 | SourceLocation incrementToken; | - | ||||||||||||||||||
1105 | }; | - | ||||||||||||||||||
1106 | - | |||||||||||||||||||
1107 | class QML_PARSER_EXPORT PostDecrementExpression: public ExpressionNode | - | ||||||||||||||||||
1108 | { | - | ||||||||||||||||||
1109 | public: | - | ||||||||||||||||||
1110 | QQMLJS_DECLARE_AST_NODE(PostDecrementExpression) | - | ||||||||||||||||||
1111 | - | |||||||||||||||||||
1112 | PostDecrementExpression(ExpressionNode *b): | - | ||||||||||||||||||
1113 | base (b) { kind = K; } executed 939 times by 9 tests: end of block Executed by:
| 939 | ||||||||||||||||||
1114 | - | |||||||||||||||||||
1115 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1116 | - | |||||||||||||||||||
1117 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1118 | { return base->firstSourceLocation(); } executed 2548 times by 9 tests: return base->firstSourceLocation(); Executed by:
| 2548 | ||||||||||||||||||
1119 | - | |||||||||||||||||||
1120 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1121 | { return decrementToken; } executed 2451 times by 6 tests: return decrementToken; Executed by:
| 2451 | ||||||||||||||||||
1122 | - | |||||||||||||||||||
1123 | // attributes | - | ||||||||||||||||||
1124 | ExpressionNode *base; | - | ||||||||||||||||||
1125 | SourceLocation decrementToken; | - | ||||||||||||||||||
1126 | }; | - | ||||||||||||||||||
1127 | - | |||||||||||||||||||
1128 | class QML_PARSER_EXPORT DeleteExpression: public ExpressionNode | - | ||||||||||||||||||
1129 | { | - | ||||||||||||||||||
1130 | public: | - | ||||||||||||||||||
1131 | QQMLJS_DECLARE_AST_NODE(DeleteExpression) | - | ||||||||||||||||||
1132 | - | |||||||||||||||||||
1133 | DeleteExpression(ExpressionNode *e): | - | ||||||||||||||||||
1134 | expression (e) { kind = K; } executed 21425 times by 9 tests: end of block Executed by:
| 21425 | ||||||||||||||||||
1135 | - | |||||||||||||||||||
1136 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1137 | - | |||||||||||||||||||
1138 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1139 | { return deleteToken; } executed 49209 times by 9 tests: return deleteToken; Executed by:
| 49209 | ||||||||||||||||||
1140 | - | |||||||||||||||||||
1141 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1142 | { return expression->lastSourceLocation(); } executed 12616 times by 3 tests: return expression->lastSourceLocation(); Executed by:
| 12616 | ||||||||||||||||||
1143 | - | |||||||||||||||||||
1144 | // attributes | - | ||||||||||||||||||
1145 | ExpressionNode *expression; | - | ||||||||||||||||||
1146 | SourceLocation deleteToken; | - | ||||||||||||||||||
1147 | }; | - | ||||||||||||||||||
1148 | - | |||||||||||||||||||
1149 | class QML_PARSER_EXPORT VoidExpression: public ExpressionNode | - | ||||||||||||||||||
1150 | { | - | ||||||||||||||||||
1151 | public: | - | ||||||||||||||||||
1152 | QQMLJS_DECLARE_AST_NODE(VoidExpression) | - | ||||||||||||||||||
1153 | - | |||||||||||||||||||
1154 | VoidExpression(ExpressionNode *e): | - | ||||||||||||||||||
1155 | expression (e) { kind = K; } executed 3306 times by 7 tests: end of block Executed by:
| 3306 | ||||||||||||||||||
1156 | - | |||||||||||||||||||
1157 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1158 | - | |||||||||||||||||||
1159 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1160 | { return voidToken; } executed 5130 times by 4 tests: return voidToken; Executed by:
| 5130 | ||||||||||||||||||
1161 | - | |||||||||||||||||||
1162 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1163 | { return expression->lastSourceLocation(); } executed 6650 times by 2 tests: return expression->lastSourceLocation(); Executed by:
| 6650 | ||||||||||||||||||
1164 | - | |||||||||||||||||||
1165 | // attributes | - | ||||||||||||||||||
1166 | ExpressionNode *expression; | - | ||||||||||||||||||
1167 | SourceLocation voidToken; | - | ||||||||||||||||||
1168 | }; | - | ||||||||||||||||||
1169 | - | |||||||||||||||||||
1170 | class QML_PARSER_EXPORT TypeOfExpression: public ExpressionNode | - | ||||||||||||||||||
1171 | { | - | ||||||||||||||||||
1172 | public: | - | ||||||||||||||||||
1173 | QQMLJS_DECLARE_AST_NODE(TypeOfExpression) | - | ||||||||||||||||||
1174 | - | |||||||||||||||||||
1175 | TypeOfExpression(ExpressionNode *e): | - | ||||||||||||||||||
1176 | expression (e) { kind = K; } executed 207496 times by 15 tests: end of block Executed by:
| 207496 | ||||||||||||||||||
1177 | - | |||||||||||||||||||
1178 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1179 | - | |||||||||||||||||||
1180 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1181 | { return typeofToken; } executed 40258 times by 3 tests: return typeofToken; Executed by:
| 40258 | ||||||||||||||||||
1182 | - | |||||||||||||||||||
1183 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1184 | { return expression->lastSourceLocation(); } executed 24249 times by 3 tests: return expression->lastSourceLocation(); Executed by:
| 24249 | ||||||||||||||||||
1185 | - | |||||||||||||||||||
1186 | // attributes | - | ||||||||||||||||||
1187 | ExpressionNode *expression; | - | ||||||||||||||||||
1188 | SourceLocation typeofToken; | - | ||||||||||||||||||
1189 | }; | - | ||||||||||||||||||
1190 | - | |||||||||||||||||||
1191 | class QML_PARSER_EXPORT PreIncrementExpression: public ExpressionNode | - | ||||||||||||||||||
1192 | { | - | ||||||||||||||||||
1193 | public: | - | ||||||||||||||||||
1194 | QQMLJS_DECLARE_AST_NODE(PreIncrementExpression) | - | ||||||||||||||||||
1195 | - | |||||||||||||||||||
1196 | PreIncrementExpression(ExpressionNode *e): | - | ||||||||||||||||||
1197 | expression (e) { kind = K; } executed 6270 times by 33 tests: end of block Executed by:
| 6270 | ||||||||||||||||||
1198 | - | |||||||||||||||||||
1199 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1200 | - | |||||||||||||||||||
1201 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1202 | { return incrementToken; } executed 4624 times by 16 tests: return incrementToken; Executed by:
| 4624 | ||||||||||||||||||
1203 | - | |||||||||||||||||||
1204 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1205 | { return expression->lastSourceLocation(); } executed 6245 times by 9 tests: return expression->lastSourceLocation(); Executed by:
| 6245 | ||||||||||||||||||
1206 | - | |||||||||||||||||||
1207 | // attributes | - | ||||||||||||||||||
1208 | ExpressionNode *expression; | - | ||||||||||||||||||
1209 | SourceLocation incrementToken; | - | ||||||||||||||||||
1210 | }; | - | ||||||||||||||||||
1211 | - | |||||||||||||||||||
1212 | class QML_PARSER_EXPORT PreDecrementExpression: public ExpressionNode | - | ||||||||||||||||||
1213 | { | - | ||||||||||||||||||
1214 | public: | - | ||||||||||||||||||
1215 | QQMLJS_DECLARE_AST_NODE(PreDecrementExpression) | - | ||||||||||||||||||
1216 | - | |||||||||||||||||||
1217 | PreDecrementExpression(ExpressionNode *e): | - | ||||||||||||||||||
1218 | expression (e) { kind = K; } executed 779 times by 7 tests: end of block Executed by:
| 779 | ||||||||||||||||||
1219 | - | |||||||||||||||||||
1220 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1221 | - | |||||||||||||||||||
1222 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1223 | { return decrementToken; } executed 2178 times by 5 tests: return decrementToken; Executed by:
| 2178 | ||||||||||||||||||
1224 | - | |||||||||||||||||||
1225 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1226 | { return expression->lastSourceLocation(); } executed 1764 times by 4 tests: return expression->lastSourceLocation(); Executed by:
| 1764 | ||||||||||||||||||
1227 | - | |||||||||||||||||||
1228 | // attributes | - | ||||||||||||||||||
1229 | ExpressionNode *expression; | - | ||||||||||||||||||
1230 | SourceLocation decrementToken; | - | ||||||||||||||||||
1231 | }; | - | ||||||||||||||||||
1232 | - | |||||||||||||||||||
1233 | class QML_PARSER_EXPORT UnaryPlusExpression: public ExpressionNode | - | ||||||||||||||||||
1234 | { | - | ||||||||||||||||||
1235 | public: | - | ||||||||||||||||||
1236 | QQMLJS_DECLARE_AST_NODE(UnaryPlusExpression) | - | ||||||||||||||||||
1237 | - | |||||||||||||||||||
1238 | UnaryPlusExpression(ExpressionNode *e): | - | ||||||||||||||||||
1239 | expression (e) { kind = K; } executed 4420 times by 4 tests: end of block Executed by:
| 4420 | ||||||||||||||||||
1240 | - | |||||||||||||||||||
1241 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1242 | - | |||||||||||||||||||
1243 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1244 | { return plusToken; } executed 6176 times by 3 tests: return plusToken; Executed by:
| 6176 | ||||||||||||||||||
1245 | - | |||||||||||||||||||
1246 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1247 | { return expression->lastSourceLocation(); } executed 10318 times by 2 tests: return expression->lastSourceLocation(); Executed by:
| 10318 | ||||||||||||||||||
1248 | - | |||||||||||||||||||
1249 | // attributes | - | ||||||||||||||||||
1250 | ExpressionNode *expression; | - | ||||||||||||||||||
1251 | SourceLocation plusToken; | - | ||||||||||||||||||
1252 | }; | - | ||||||||||||||||||
1253 | - | |||||||||||||||||||
1254 | class QML_PARSER_EXPORT UnaryMinusExpression: public ExpressionNode | - | ||||||||||||||||||
1255 | { | - | ||||||||||||||||||
1256 | public: | - | ||||||||||||||||||
1257 | QQMLJS_DECLARE_AST_NODE(UnaryMinusExpression) | - | ||||||||||||||||||
1258 | - | |||||||||||||||||||
1259 | UnaryMinusExpression(ExpressionNode *e): | - | ||||||||||||||||||
1260 | expression (e) { kind = K; } executed 95835 times by 40 tests: end of block Executed by:
| 95835 | ||||||||||||||||||
1261 | - | |||||||||||||||||||
1262 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1263 | - | |||||||||||||||||||
1264 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1265 | { return minusToken; } executed 208035 times by 33 tests: return minusToken; Executed by:
| 208035 | ||||||||||||||||||
1266 | - | |||||||||||||||||||
1267 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1268 | { return expression->lastSourceLocation(); } executed 237441 times by 10 tests: return expression->lastSourceLocation(); Executed by:
| 237441 | ||||||||||||||||||
1269 | - | |||||||||||||||||||
1270 | // attributes | - | ||||||||||||||||||
1271 | ExpressionNode *expression; | - | ||||||||||||||||||
1272 | SourceLocation minusToken; | - | ||||||||||||||||||
1273 | }; | - | ||||||||||||||||||
1274 | - | |||||||||||||||||||
1275 | class QML_PARSER_EXPORT TildeExpression: public ExpressionNode | - | ||||||||||||||||||
1276 | { | - | ||||||||||||||||||
1277 | public: | - | ||||||||||||||||||
1278 | QQMLJS_DECLARE_AST_NODE(TildeExpression) | - | ||||||||||||||||||
1279 | - | |||||||||||||||||||
1280 | TildeExpression(ExpressionNode *e): | - | ||||||||||||||||||
1281 | expression (e) { kind = K; } executed 914 times by 5 tests: end of block Executed by:
| 914 | ||||||||||||||||||
1282 | - | |||||||||||||||||||
1283 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1284 | - | |||||||||||||||||||
1285 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1286 | { return tildeToken; } executed 1632 times by 3 tests: return tildeToken; Executed by:
| 1632 | ||||||||||||||||||
1287 | - | |||||||||||||||||||
1288 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1289 | { return expression->lastSourceLocation(); } executed 1446 times by 2 tests: return expression->lastSourceLocation(); Executed by:
| 1446 | ||||||||||||||||||
1290 | - | |||||||||||||||||||
1291 | // attributes | - | ||||||||||||||||||
1292 | ExpressionNode *expression; | - | ||||||||||||||||||
1293 | SourceLocation tildeToken; | - | ||||||||||||||||||
1294 | }; | - | ||||||||||||||||||
1295 | - | |||||||||||||||||||
1296 | class QML_PARSER_EXPORT NotExpression: public ExpressionNode | - | ||||||||||||||||||
1297 | { | - | ||||||||||||||||||
1298 | public: | - | ||||||||||||||||||
1299 | QQMLJS_DECLARE_AST_NODE(NotExpression) | - | ||||||||||||||||||
1300 | - | |||||||||||||||||||
1301 | NotExpression(ExpressionNode *e): | - | ||||||||||||||||||
1302 | expression (e) { kind = K; } executed 207918 times by 34 tests: end of block Executed by:
| 207918 | ||||||||||||||||||
1303 | - | |||||||||||||||||||
1304 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1305 | - | |||||||||||||||||||
1306 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1307 | { return notToken; } executed 176837 times by 27 tests: return notToken; Executed by:
| 176837 | ||||||||||||||||||
1308 | - | |||||||||||||||||||
1309 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1310 | { return expression->lastSourceLocation(); } executed 27063 times by 15 tests: return expression->lastSourceLocation(); Executed by:
| 27063 | ||||||||||||||||||
1311 | - | |||||||||||||||||||
1312 | // attributes | - | ||||||||||||||||||
1313 | ExpressionNode *expression; | - | ||||||||||||||||||
1314 | SourceLocation notToken; | - | ||||||||||||||||||
1315 | }; | - | ||||||||||||||||||
1316 | - | |||||||||||||||||||
1317 | class QML_PARSER_EXPORT BinaryExpression: public ExpressionNode | - | ||||||||||||||||||
1318 | { | - | ||||||||||||||||||
1319 | public: | - | ||||||||||||||||||
1320 | QQMLJS_DECLARE_AST_NODE(BinaryExpression) | - | ||||||||||||||||||
1321 | - | |||||||||||||||||||
1322 | BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r): | - | ||||||||||||||||||
1323 | left (l), op (o), right (r) | - | ||||||||||||||||||
1324 | { kind = K; } executed 6574424 times by 100 tests: end of block Executed by:
| 6574424 | ||||||||||||||||||
1325 | - | |||||||||||||||||||
1326 | BinaryExpression *binaryExpressionCast() override; | - | ||||||||||||||||||
1327 | - | |||||||||||||||||||
1328 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1329 | - | |||||||||||||||||||
1330 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1331 | { return left->firstSourceLocation(); } executed 6044993 times by 99 tests: return left->firstSourceLocation(); Executed by:
| 6044993 | ||||||||||||||||||
1332 | - | |||||||||||||||||||
1333 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1334 | { return right->lastSourceLocation(); } executed 2032292 times by 77 tests: return right->lastSourceLocation(); Executed by:
| 2032292 | ||||||||||||||||||
1335 | - | |||||||||||||||||||
1336 | // attributes | - | ||||||||||||||||||
1337 | ExpressionNode *left; | - | ||||||||||||||||||
1338 | int op; | - | ||||||||||||||||||
1339 | ExpressionNode *right; | - | ||||||||||||||||||
1340 | SourceLocation operatorToken; | - | ||||||||||||||||||
1341 | }; | - | ||||||||||||||||||
1342 | - | |||||||||||||||||||
1343 | class QML_PARSER_EXPORT ConditionalExpression: public ExpressionNode | - | ||||||||||||||||||
1344 | { | - | ||||||||||||||||||
1345 | public: | - | ||||||||||||||||||
1346 | QQMLJS_DECLARE_AST_NODE(ConditionalExpression) | - | ||||||||||||||||||
1347 | - | |||||||||||||||||||
1348 | ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f): | - | ||||||||||||||||||
1349 | expression (e), ok (t), ko (f) | - | ||||||||||||||||||
1350 | { kind = K; } executed 29787 times by 45 tests: end of block Executed by:
| 29787 | ||||||||||||||||||
1351 | - | |||||||||||||||||||
1352 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1353 | - | |||||||||||||||||||
1354 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1355 | { return expression->firstSourceLocation(); } executed 22712 times by 38 tests: return expression->firstSourceLocation(); Executed by:
| 22712 | ||||||||||||||||||
1356 | - | |||||||||||||||||||
1357 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1358 | { return ko->lastSourceLocation(); } executed 37771 times by 37 tests: return ko->lastSourceLocation(); Executed by:
| 37771 | ||||||||||||||||||
1359 | - | |||||||||||||||||||
1360 | // attributes | - | ||||||||||||||||||
1361 | ExpressionNode *expression; | - | ||||||||||||||||||
1362 | ExpressionNode *ok; | - | ||||||||||||||||||
1363 | ExpressionNode *ko; | - | ||||||||||||||||||
1364 | SourceLocation questionToken; | - | ||||||||||||||||||
1365 | SourceLocation colonToken; | - | ||||||||||||||||||
1366 | }; | - | ||||||||||||||||||
1367 | - | |||||||||||||||||||
1368 | class QML_PARSER_EXPORT Expression: public ExpressionNode // ### rename | - | ||||||||||||||||||
1369 | { | - | ||||||||||||||||||
1370 | public: | - | ||||||||||||||||||
1371 | QQMLJS_DECLARE_AST_NODE(Expression) | - | ||||||||||||||||||
1372 | - | |||||||||||||||||||
1373 | Expression(ExpressionNode *l, ExpressionNode *r): | - | ||||||||||||||||||
1374 | left (l), right (r) { kind = K; } executed 7098 times by 7 tests: end of block Executed by:
| 7098 | ||||||||||||||||||
1375 | - | |||||||||||||||||||
1376 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1377 | - | |||||||||||||||||||
1378 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1379 | { return left->firstSourceLocation(); } executed 10981 times by 6 tests: return left->firstSourceLocation(); Executed by:
| 10981 | ||||||||||||||||||
1380 | - | |||||||||||||||||||
1381 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1382 | { return right->lastSourceLocation(); } executed 9201 times by 4 tests: return right->lastSourceLocation(); Executed by:
| 9201 | ||||||||||||||||||
1383 | - | |||||||||||||||||||
1384 | // attributes | - | ||||||||||||||||||
1385 | ExpressionNode *left; | - | ||||||||||||||||||
1386 | ExpressionNode *right; | - | ||||||||||||||||||
1387 | SourceLocation commaToken; | - | ||||||||||||||||||
1388 | }; | - | ||||||||||||||||||
1389 | - | |||||||||||||||||||
1390 | class QML_PARSER_EXPORT Block: public Statement | - | ||||||||||||||||||
1391 | { | - | ||||||||||||||||||
1392 | public: | - | ||||||||||||||||||
1393 | QQMLJS_DECLARE_AST_NODE(Block) | - | ||||||||||||||||||
1394 | - | |||||||||||||||||||
1395 | Block(StatementList *slist): | - | ||||||||||||||||||
1396 | statements (slist) { kind = K; } executed 1906183 times by 78 tests: end of block Executed by:
| 1906183 | ||||||||||||||||||
1397 | - | |||||||||||||||||||
1398 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1399 | - | |||||||||||||||||||
1400 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1401 | { return lbraceToken; } executed 3495348 times by 78 tests: return lbraceToken; Executed by:
| 3495348 | ||||||||||||||||||
1402 | - | |||||||||||||||||||
1403 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1404 | { return rbraceToken; } executed 737235 times by 78 tests: return rbraceToken; Executed by:
| 737235 | ||||||||||||||||||
1405 | - | |||||||||||||||||||
1406 | // attributes | - | ||||||||||||||||||
1407 | StatementList *statements; | - | ||||||||||||||||||
1408 | SourceLocation lbraceToken; | - | ||||||||||||||||||
1409 | SourceLocation rbraceToken; | - | ||||||||||||||||||
1410 | }; | - | ||||||||||||||||||
1411 | - | |||||||||||||||||||
1412 | class QML_PARSER_EXPORT StatementList: public Node | - | ||||||||||||||||||
1413 | { | - | ||||||||||||||||||
1414 | public: | - | ||||||||||||||||||
1415 | QQMLJS_DECLARE_AST_NODE(StatementList) | - | ||||||||||||||||||
1416 | - | |||||||||||||||||||
1417 | // ### This should be a Statement, but FunctionDeclaration currently doesn't inherit it. | - | ||||||||||||||||||
1418 | StatementList(Node *stmt) | - | ||||||||||||||||||
1419 | : statement(stmt), next (this) | - | ||||||||||||||||||
1420 | { kind = K; } executed 9494092 times by 103 tests: end of block Executed by:
| 9494092 | ||||||||||||||||||
1421 | - | |||||||||||||||||||
1422 | StatementList *append(StatementList *n) { | - | ||||||||||||||||||
1423 | n->next = next; | - | ||||||||||||||||||
1424 | next = n; | - | ||||||||||||||||||
1425 | return n; executed 4048332 times by 84 tests: return n; Executed by:
| 4048332 | ||||||||||||||||||
1426 | } | - | ||||||||||||||||||
1427 | - | |||||||||||||||||||
1428 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1429 | - | |||||||||||||||||||
1430 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1431 | { return statement->firstSourceLocation(); } executed 5604035 times by 41 tests: return statement->firstSourceLocation(); Executed by:
| 5604035 | ||||||||||||||||||
1432 | - | |||||||||||||||||||
1433 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1434 | { return next ? next->lastSourceLocation() : statement->lastSourceLocation(); } executed 36263534 times by 41 tests: return next ? next->lastSourceLocation() : statement->lastSourceLocation(); Executed by:
| 36263534 | ||||||||||||||||||
1435 | - | |||||||||||||||||||
1436 | inline StatementList *finish () | - | ||||||||||||||||||
1437 | { | - | ||||||||||||||||||
1438 | StatementList *front = next; | - | ||||||||||||||||||
1439 | next = nullptr; | - | ||||||||||||||||||
1440 | return front; executed 5439909 times by 103 tests: return front; Executed by:
| 5439909 | ||||||||||||||||||
1441 | } | - | ||||||||||||||||||
1442 | - | |||||||||||||||||||
1443 | // attributes | - | ||||||||||||||||||
1444 | Node *statement = nullptr; | - | ||||||||||||||||||
1445 | StatementList *next; | - | ||||||||||||||||||
1446 | }; | - | ||||||||||||||||||
1447 | - | |||||||||||||||||||
1448 | class QML_PARSER_EXPORT VariableDeclarationList: public Node | - | ||||||||||||||||||
1449 | { | - | ||||||||||||||||||
1450 | public: | - | ||||||||||||||||||
1451 | QQMLJS_DECLARE_AST_NODE(VariableDeclarationList) | - | ||||||||||||||||||
1452 | - | |||||||||||||||||||
1453 | VariableDeclarationList(PatternElement *decl) | - | ||||||||||||||||||
1454 | : declaration(decl), next(this) | - | ||||||||||||||||||
1455 | { kind = K; } executed 693840 times by 51 tests: end of block Executed by:
| 693840 | ||||||||||||||||||
1456 | - | |||||||||||||||||||
1457 | VariableDeclarationList(VariableDeclarationList *previous, PatternElement *decl) | - | ||||||||||||||||||
1458 | : declaration(decl) | - | ||||||||||||||||||
1459 | { | - | ||||||||||||||||||
1460 | kind = K; | - | ||||||||||||||||||
1461 | next = previous->next; | - | ||||||||||||||||||
1462 | previous->next = this; | - | ||||||||||||||||||
1463 | } executed 6651 times by 10 tests: end of block Executed by:
| 6651 | ||||||||||||||||||
1464 | - | |||||||||||||||||||
1465 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1466 | - | |||||||||||||||||||
1467 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1468 | { return declaration->firstSourceLocation(); } executed 329998 times by 1 test: return declaration->firstSourceLocation(); Executed by:
| 329998 | ||||||||||||||||||
1469 | - | |||||||||||||||||||
1470 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1471 | { | - | ||||||||||||||||||
1472 | if (next)
| 26230-652753 | ||||||||||||||||||
1473 | return next->lastSourceLocation(); executed 26230 times by 2 tests: return next->lastSourceLocation(); Executed by:
| 26230 | ||||||||||||||||||
1474 | return declaration->lastSourceLocation(); executed 652754 times by 9 tests: return declaration->lastSourceLocation(); Executed by:
| 652754 | ||||||||||||||||||
1475 | } | - | ||||||||||||||||||
1476 | - | |||||||||||||||||||
1477 | inline VariableDeclarationList *finish(VariableScope s) | - | ||||||||||||||||||
1478 | { | - | ||||||||||||||||||
1479 | VariableDeclarationList *front = next; | - | ||||||||||||||||||
1480 | next = nullptr; | - | ||||||||||||||||||
1481 | VariableDeclarationList *vdl; | - | ||||||||||||||||||
1482 | for (vdl = front; vdl != nullptr; vdl = vdl->next) {
| 695118-701275 | ||||||||||||||||||
1483 | vdl->declaration->scope = s; | - | ||||||||||||||||||
1484 | } executed 700442 times by 51 tests: end of block Executed by:
| 700442 | ||||||||||||||||||
1485 | return front; executed 695503 times by 51 tests: return front; Executed by:
| 695503 | ||||||||||||||||||
1486 | } | - | ||||||||||||||||||
1487 | - | |||||||||||||||||||
1488 | // attributes | - | ||||||||||||||||||
1489 | PatternElement *declaration; | - | ||||||||||||||||||
1490 | VariableDeclarationList *next; | - | ||||||||||||||||||
1491 | SourceLocation commaToken; | - | ||||||||||||||||||
1492 | }; | - | ||||||||||||||||||
1493 | - | |||||||||||||||||||
1494 | class QML_PARSER_EXPORT VariableStatement: public Statement | - | ||||||||||||||||||
1495 | { | - | ||||||||||||||||||
1496 | public: | - | ||||||||||||||||||
1497 | QQMLJS_DECLARE_AST_NODE(VariableStatement) | - | ||||||||||||||||||
1498 | - | |||||||||||||||||||
1499 | VariableStatement(VariableDeclarationList *vlist): | - | ||||||||||||||||||
1500 | declarations (vlist) | - | ||||||||||||||||||
1501 | { kind = K; } executed 694812 times by 51 tests: end of block Executed by:
| 694812 | ||||||||||||||||||
1502 | - | |||||||||||||||||||
1503 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1504 | - | |||||||||||||||||||
1505 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1506 | { return declarationKindToken; } executed 1205907 times by 49 tests: return declarationKindToken; Executed by:
| 1205907 | ||||||||||||||||||
1507 | - | |||||||||||||||||||
1508 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1509 | { return declarations->lastSourceLocation(); } executed 322756 times by 9 tests: return declarations->lastSourceLocation(); Executed by:
| 322756 | ||||||||||||||||||
1510 | - | |||||||||||||||||||
1511 | // attributes | - | ||||||||||||||||||
1512 | VariableDeclarationList *declarations; | - | ||||||||||||||||||
1513 | SourceLocation declarationKindToken; | - | ||||||||||||||||||
1514 | }; | - | ||||||||||||||||||
1515 | - | |||||||||||||||||||
1516 | class QML_PARSER_EXPORT EmptyStatement: public Statement | - | ||||||||||||||||||
1517 | { | - | ||||||||||||||||||
1518 | public: | - | ||||||||||||||||||
1519 | QQMLJS_DECLARE_AST_NODE(EmptyStatement) | - | ||||||||||||||||||
1520 | - | |||||||||||||||||||
1521 | EmptyStatement() { kind = K; } executed 4598 times by 8 tests: end of block Executed by:
| 4598 | ||||||||||||||||||
1522 | - | |||||||||||||||||||
1523 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1524 | - | |||||||||||||||||||
1525 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1526 | { return semicolonToken; } executed 5726 times by 8 tests: return semicolonToken; Executed by:
| 5726 | ||||||||||||||||||
1527 | - | |||||||||||||||||||
1528 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1529 | { return semicolonToken; } executed 5566 times by 4 tests: return semicolonToken; Executed by:
| 5566 | ||||||||||||||||||
1530 | - | |||||||||||||||||||
1531 | // attributes | - | ||||||||||||||||||
1532 | SourceLocation semicolonToken; | - | ||||||||||||||||||
1533 | }; | - | ||||||||||||||||||
1534 | - | |||||||||||||||||||
1535 | class QML_PARSER_EXPORT ExpressionStatement: public Statement | - | ||||||||||||||||||
1536 | { | - | ||||||||||||||||||
1537 | public: | - | ||||||||||||||||||
1538 | QQMLJS_DECLARE_AST_NODE(ExpressionStatement) | - | ||||||||||||||||||
1539 | - | |||||||||||||||||||
1540 | ExpressionStatement(ExpressionNode *e): | - | ||||||||||||||||||
1541 | expression (e) { kind = K; } executed 6342993 times by 148 tests: end of block Executed by:
| 6342993 | ||||||||||||||||||
1542 | - | |||||||||||||||||||
1543 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1544 | - | |||||||||||||||||||
1545 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1546 | { return expression->firstSourceLocation(); } executed 17751975 times by 148 tests: return expression->firstSourceLocation(); Executed by:
| 17751975 | ||||||||||||||||||
1547 | - | |||||||||||||||||||
1548 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1549 | { return expression->lastSourceLocation(); } executed 5210744 times by 138 tests: return expression->lastSourceLocation(); Executed by:
| 5210744 | ||||||||||||||||||
1550 | - | |||||||||||||||||||
1551 | // attributes | - | ||||||||||||||||||
1552 | ExpressionNode *expression; | - | ||||||||||||||||||
1553 | SourceLocation semicolonToken; | - | ||||||||||||||||||
1554 | }; | - | ||||||||||||||||||
1555 | - | |||||||||||||||||||
1556 | class QML_PARSER_EXPORT IfStatement: public Statement | - | ||||||||||||||||||
1557 | { | - | ||||||||||||||||||
1558 | public: | - | ||||||||||||||||||
1559 | QQMLJS_DECLARE_AST_NODE(IfStatement) | - | ||||||||||||||||||
1560 | - | |||||||||||||||||||
1561 | IfStatement(ExpressionNode *e, Statement *t, Statement *f = nullptr): | - | ||||||||||||||||||
1562 | expression (e), ok (t), ko (f) | - | ||||||||||||||||||
1563 | { kind = K; } executed 1342021 times by 60 tests: end of block Executed by:
| 1342021 | ||||||||||||||||||
1564 | - | |||||||||||||||||||
1565 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1566 | - | |||||||||||||||||||
1567 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1568 | { return ifToken; } executed 1545830 times by 60 tests: return ifToken; Executed by:
| 1545830 | ||||||||||||||||||
1569 | - | |||||||||||||||||||
1570 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1571 | { | - | ||||||||||||||||||
1572 | if (ko)
| 40181-370932 | ||||||||||||||||||
1573 | return ko->lastSourceLocation(); executed 40181 times by 10 tests: return ko->lastSourceLocation(); Executed by:
| 40181 | ||||||||||||||||||
1574 | - | |||||||||||||||||||
1575 | return ok->lastSourceLocation(); executed 370929 times by 16 tests: return ok->lastSourceLocation(); Executed by:
| 370929 | ||||||||||||||||||
1576 | } | - | ||||||||||||||||||
1577 | - | |||||||||||||||||||
1578 | // attributes | - | ||||||||||||||||||
1579 | ExpressionNode *expression; | - | ||||||||||||||||||
1580 | Statement *ok; | - | ||||||||||||||||||
1581 | Statement *ko; | - | ||||||||||||||||||
1582 | SourceLocation ifToken; | - | ||||||||||||||||||
1583 | SourceLocation lparenToken; | - | ||||||||||||||||||
1584 | SourceLocation rparenToken; | - | ||||||||||||||||||
1585 | SourceLocation elseToken; | - | ||||||||||||||||||
1586 | }; | - | ||||||||||||||||||
1587 | - | |||||||||||||||||||
1588 | class QML_PARSER_EXPORT DoWhileStatement: public Statement | - | ||||||||||||||||||
1589 | { | - | ||||||||||||||||||
1590 | public: | - | ||||||||||||||||||
1591 | QQMLJS_DECLARE_AST_NODE(DoWhileStatement) | - | ||||||||||||||||||
1592 | - | |||||||||||||||||||
1593 | DoWhileStatement(Statement *stmt, ExpressionNode *e): | - | ||||||||||||||||||
1594 | statement (stmt), expression (e) | - | ||||||||||||||||||
1595 | { kind = K; } executed 985 times by 11 tests: end of block Executed by:
| 985 | ||||||||||||||||||
1596 | - | |||||||||||||||||||
1597 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1598 | - | |||||||||||||||||||
1599 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1600 | { return doToken; } executed 1878 times by 11 tests: return doToken; Executed by:
| 1878 | ||||||||||||||||||
1601 | - | |||||||||||||||||||
1602 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1603 | { return semicolonToken; } executed 1790 times by 2 tests: return semicolonToken; Executed by:
| 1790 | ||||||||||||||||||
1604 | - | |||||||||||||||||||
1605 | // attributes | - | ||||||||||||||||||
1606 | Statement *statement; | - | ||||||||||||||||||
1607 | ExpressionNode *expression; | - | ||||||||||||||||||
1608 | SourceLocation doToken; | - | ||||||||||||||||||
1609 | SourceLocation whileToken; | - | ||||||||||||||||||
1610 | SourceLocation lparenToken; | - | ||||||||||||||||||
1611 | SourceLocation rparenToken; | - | ||||||||||||||||||
1612 | SourceLocation semicolonToken; | - | ||||||||||||||||||
1613 | }; | - | ||||||||||||||||||
1614 | - | |||||||||||||||||||
1615 | class QML_PARSER_EXPORT WhileStatement: public Statement | - | ||||||||||||||||||
1616 | { | - | ||||||||||||||||||
1617 | public: | - | ||||||||||||||||||
1618 | QQMLJS_DECLARE_AST_NODE(WhileStatement) | - | ||||||||||||||||||
1619 | - | |||||||||||||||||||
1620 | WhileStatement(ExpressionNode *e, Statement *stmt): | - | ||||||||||||||||||
1621 | expression (e), statement (stmt) | - | ||||||||||||||||||
1622 | { kind = K; } executed 1774 times by 14 tests: end of block Executed by:
| 1774 | ||||||||||||||||||
1623 | - | |||||||||||||||||||
1624 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1625 | - | |||||||||||||||||||
1626 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1627 | { return whileToken; } executed 4108 times by 14 tests: return whileToken; Executed by:
| 4108 | ||||||||||||||||||
1628 | - | |||||||||||||||||||
1629 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1630 | { return statement->lastSourceLocation(); } executed 3696 times by 2 tests: return statement->lastSourceLocation(); Executed by:
| 3696 | ||||||||||||||||||
1631 | - | |||||||||||||||||||
1632 | // attributes | - | ||||||||||||||||||
1633 | ExpressionNode *expression; | - | ||||||||||||||||||
1634 | Statement *statement; | - | ||||||||||||||||||
1635 | SourceLocation whileToken; | - | ||||||||||||||||||
1636 | SourceLocation lparenToken; | - | ||||||||||||||||||
1637 | SourceLocation rparenToken; | - | ||||||||||||||||||
1638 | }; | - | ||||||||||||||||||
1639 | - | |||||||||||||||||||
1640 | class QML_PARSER_EXPORT ForStatement: public Statement | - | ||||||||||||||||||
1641 | { | - | ||||||||||||||||||
1642 | public: | - | ||||||||||||||||||
1643 | QQMLJS_DECLARE_AST_NODE(ForStatement) | - | ||||||||||||||||||
1644 | - | |||||||||||||||||||
1645 | ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt): | - | ||||||||||||||||||
1646 | initialiser (i), condition (c), expression (e), statement (stmt) | - | ||||||||||||||||||
1647 | { kind = K; } executed 2237 times by 12 tests: end of block Executed by:
| 2237 | ||||||||||||||||||
1648 | - | |||||||||||||||||||
1649 | ForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt): | - | ||||||||||||||||||
1650 | declarations (vlist), condition (c), expression (e), statement (stmt) | - | ||||||||||||||||||
1651 | { kind = K; } executed 18353 times by 28 tests: end of block Executed by:
| 18353 | ||||||||||||||||||
1652 | - | |||||||||||||||||||
1653 | - | |||||||||||||||||||
1654 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1655 | - | |||||||||||||||||||
1656 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1657 | { return forToken; } executed 66501 times by 28 tests: return forToken; Executed by:
| 66501 | ||||||||||||||||||
1658 | - | |||||||||||||||||||
1659 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1660 | { return statement->lastSourceLocation(); } executed 49733 times by 3 tests: return statement->lastSourceLocation(); Executed by:
| 49733 | ||||||||||||||||||
1661 | - | |||||||||||||||||||
1662 | // attributes | - | ||||||||||||||||||
1663 | ExpressionNode *initialiser = nullptr; | - | ||||||||||||||||||
1664 | VariableDeclarationList *declarations = nullptr; | - | ||||||||||||||||||
1665 | ExpressionNode *condition; | - | ||||||||||||||||||
1666 | ExpressionNode *expression; | - | ||||||||||||||||||
1667 | Statement *statement; | - | ||||||||||||||||||
1668 | SourceLocation forToken; | - | ||||||||||||||||||
1669 | SourceLocation lparenToken; | - | ||||||||||||||||||
1670 | SourceLocation firstSemicolonToken; | - | ||||||||||||||||||
1671 | SourceLocation secondSemicolonToken; | - | ||||||||||||||||||
1672 | SourceLocation rparenToken; | - | ||||||||||||||||||
1673 | }; | - | ||||||||||||||||||
1674 | - | |||||||||||||||||||
1675 | enum class ForEachType { | - | ||||||||||||||||||
1676 | In, | - | ||||||||||||||||||
1677 | Of | - | ||||||||||||||||||
1678 | }; | - | ||||||||||||||||||
1679 | - | |||||||||||||||||||
1680 | class QML_PARSER_EXPORT ForEachStatement: public Statement | - | ||||||||||||||||||
1681 | { | - | ||||||||||||||||||
1682 | public: | - | ||||||||||||||||||
1683 | QQMLJS_DECLARE_AST_NODE(ForEachStatement) | - | ||||||||||||||||||
1684 | - | |||||||||||||||||||
1685 | ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt) | - | ||||||||||||||||||
1686 | : lhs(i), expression(e), statement(stmt) | - | ||||||||||||||||||
1687 | { kind = K; } executed 2525 times by 10 tests: end of block Executed by:
| 2525 | ||||||||||||||||||
1688 | ForEachStatement(PatternElement *v, ExpressionNode *e, Statement *stmt) | - | ||||||||||||||||||
1689 | : lhs(v), expression(e), statement(stmt) | - | ||||||||||||||||||
1690 | { kind = K; } executed 15158 times by 13 tests: end of block Executed by:
| 15158 | ||||||||||||||||||
1691 | - | |||||||||||||||||||
1692 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1693 | - | |||||||||||||||||||
1694 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1695 | { return forToken; } executed 43362 times by 14 tests: return forToken; Executed by:
| 43362 | ||||||||||||||||||
1696 | - | |||||||||||||||||||
1697 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1698 | { return statement->lastSourceLocation(); } executed 19712 times by 3 tests: return statement->lastSourceLocation(); Executed by:
| 19712 | ||||||||||||||||||
1699 | - | |||||||||||||||||||
1700 | PatternElement *declaration() const { | - | ||||||||||||||||||
1701 | return AST::cast<PatternElement *>(lhs); never executed: return AST::cast<PatternElement *>(lhs); | 0 | ||||||||||||||||||
1702 | } | - | ||||||||||||||||||
1703 | - | |||||||||||||||||||
1704 | // attributes | - | ||||||||||||||||||
1705 | Node *lhs; | - | ||||||||||||||||||
1706 | ExpressionNode *expression; | - | ||||||||||||||||||
1707 | Statement *statement; | - | ||||||||||||||||||
1708 | SourceLocation forToken; | - | ||||||||||||||||||
1709 | SourceLocation lparenToken; | - | ||||||||||||||||||
1710 | SourceLocation inOfToken; | - | ||||||||||||||||||
1711 | SourceLocation rparenToken; | - | ||||||||||||||||||
1712 | ForEachType type; | - | ||||||||||||||||||
1713 | }; | - | ||||||||||||||||||
1714 | - | |||||||||||||||||||
1715 | class QML_PARSER_EXPORT ContinueStatement: public Statement | - | ||||||||||||||||||
1716 | { | - | ||||||||||||||||||
1717 | public: | - | ||||||||||||||||||
1718 | QQMLJS_DECLARE_AST_NODE(ContinueStatement) | - | ||||||||||||||||||
1719 | - | |||||||||||||||||||
1720 | ContinueStatement(const QStringRef &l = QStringRef()): | - | ||||||||||||||||||
1721 | label (l) { kind = K; } executed 1484 times by 10 tests: end of block Executed by:
| 1484 | ||||||||||||||||||
1722 | - | |||||||||||||||||||
1723 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1724 | - | |||||||||||||||||||
1725 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1726 | { return continueToken; } executed 2032 times by 10 tests: return continueToken; Executed by:
| 2032 | ||||||||||||||||||
1727 | - | |||||||||||||||||||
1728 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1729 | { return semicolonToken; } executed 2770 times by 3 tests: return semicolonToken; Executed by:
| 2770 | ||||||||||||||||||
1730 | - | |||||||||||||||||||
1731 | // attributes | - | ||||||||||||||||||
1732 | QStringRef label; | - | ||||||||||||||||||
1733 | SourceLocation continueToken; | - | ||||||||||||||||||
1734 | SourceLocation identifierToken; | - | ||||||||||||||||||
1735 | SourceLocation semicolonToken; | - | ||||||||||||||||||
1736 | }; | - | ||||||||||||||||||
1737 | - | |||||||||||||||||||
1738 | class QML_PARSER_EXPORT BreakStatement: public Statement | - | ||||||||||||||||||
1739 | { | - | ||||||||||||||||||
1740 | public: | - | ||||||||||||||||||
1741 | QQMLJS_DECLARE_AST_NODE(BreakStatement) | - | ||||||||||||||||||
1742 | - | |||||||||||||||||||
1743 | BreakStatement(const QStringRef &l): | - | ||||||||||||||||||
1744 | label (l) { kind = K; } executed 22105 times by 10 tests: end of block Executed by:
| 22105 | ||||||||||||||||||
1745 | - | |||||||||||||||||||
1746 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1747 | - | |||||||||||||||||||
1748 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1749 | { return breakToken; } executed 27543 times by 10 tests: return breakToken; Executed by:
| 27543 | ||||||||||||||||||
1750 | - | |||||||||||||||||||
1751 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1752 | { return semicolonToken; } executed 49388 times by 2 tests: return semicolonToken; Executed by:
| 49388 | ||||||||||||||||||
1753 | - | |||||||||||||||||||
1754 | // attributes | - | ||||||||||||||||||
1755 | QStringRef label; | - | ||||||||||||||||||
1756 | SourceLocation breakToken; | - | ||||||||||||||||||
1757 | SourceLocation identifierToken; | - | ||||||||||||||||||
1758 | SourceLocation semicolonToken; | - | ||||||||||||||||||
1759 | }; | - | ||||||||||||||||||
1760 | - | |||||||||||||||||||
1761 | class QML_PARSER_EXPORT ReturnStatement: public Statement | - | ||||||||||||||||||
1762 | { | - | ||||||||||||||||||
1763 | public: | - | ||||||||||||||||||
1764 | QQMLJS_DECLARE_AST_NODE(ReturnStatement) | - | ||||||||||||||||||
1765 | - | |||||||||||||||||||
1766 | ReturnStatement(ExpressionNode *e): | - | ||||||||||||||||||
1767 | expression (e) { kind = K; } executed 827879 times by 49 tests: end of block Executed by:
| 827879 | ||||||||||||||||||
1768 | - | |||||||||||||||||||
1769 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1770 | - | |||||||||||||||||||
1771 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1772 | { return returnToken; } executed 879458 times by 49 tests: return returnToken; Executed by:
| 879458 | ||||||||||||||||||
1773 | - | |||||||||||||||||||
1774 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1775 | { return semicolonToken; } executed 195799 times by 2 tests: return semicolonToken; Executed by:
| 195799 | ||||||||||||||||||
1776 | - | |||||||||||||||||||
1777 | // attributes | - | ||||||||||||||||||
1778 | ExpressionNode *expression; | - | ||||||||||||||||||
1779 | SourceLocation returnToken; | - | ||||||||||||||||||
1780 | SourceLocation semicolonToken; | - | ||||||||||||||||||
1781 | }; | - | ||||||||||||||||||
1782 | - | |||||||||||||||||||
1783 | class QML_PARSER_EXPORT YieldExpression: public ExpressionNode | - | ||||||||||||||||||
1784 | { | - | ||||||||||||||||||
1785 | public: | - | ||||||||||||||||||
1786 | QQMLJS_DECLARE_AST_NODE(YieldExpression) | - | ||||||||||||||||||
1787 | - | |||||||||||||||||||
1788 | YieldExpression(ExpressionNode *e = nullptr): | - | ||||||||||||||||||
1789 | expression (e) { kind = K; } executed 4848 times by 2 tests: end of block Executed by:
| 4848 | ||||||||||||||||||
1790 | - | |||||||||||||||||||
1791 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1792 | - | |||||||||||||||||||
1793 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1794 | { return yieldToken; } executed 11111 times by 2 tests: return yieldToken; Executed by:
| 11111 | ||||||||||||||||||
1795 | - | |||||||||||||||||||
1796 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1797 | { return expression ? expression->lastSourceLocation() : yieldToken; } executed 8108 times by 1 test: return expression ? expression->lastSourceLocation() : yieldToken; Executed by:
| 8108 | ||||||||||||||||||
1798 | - | |||||||||||||||||||
1799 | // attributes | - | ||||||||||||||||||
1800 | ExpressionNode *expression; | - | ||||||||||||||||||
1801 | bool isYieldStar = false; | - | ||||||||||||||||||
1802 | SourceLocation yieldToken; | - | ||||||||||||||||||
1803 | }; | - | ||||||||||||||||||
1804 | - | |||||||||||||||||||
1805 | class QML_PARSER_EXPORT WithStatement: public Statement | - | ||||||||||||||||||
1806 | { | - | ||||||||||||||||||
1807 | public: | - | ||||||||||||||||||
1808 | QQMLJS_DECLARE_AST_NODE(WithStatement) | - | ||||||||||||||||||
1809 | - | |||||||||||||||||||
1810 | WithStatement(ExpressionNode *e, Statement *stmt): | - | ||||||||||||||||||
1811 | expression (e), statement (stmt) | - | ||||||||||||||||||
1812 | { kind = K; } executed 1512 times by 7 tests: end of block Executed by:
| 1512 | ||||||||||||||||||
1813 | - | |||||||||||||||||||
1814 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1815 | - | |||||||||||||||||||
1816 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1817 | { return withToken; } executed 5181 times by 7 tests: return withToken; Executed by:
| 5181 | ||||||||||||||||||
1818 | - | |||||||||||||||||||
1819 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1820 | { return statement->lastSourceLocation(); } executed 3702 times by 5 tests: return statement->lastSourceLocation(); Executed by:
| 3702 | ||||||||||||||||||
1821 | - | |||||||||||||||||||
1822 | // attributes | - | ||||||||||||||||||
1823 | ExpressionNode *expression; | - | ||||||||||||||||||
1824 | Statement *statement; | - | ||||||||||||||||||
1825 | SourceLocation withToken; | - | ||||||||||||||||||
1826 | SourceLocation lparenToken; | - | ||||||||||||||||||
1827 | SourceLocation rparenToken; | - | ||||||||||||||||||
1828 | }; | - | ||||||||||||||||||
1829 | - | |||||||||||||||||||
1830 | class QML_PARSER_EXPORT CaseBlock: public Node | - | ||||||||||||||||||
1831 | { | - | ||||||||||||||||||
1832 | public: | - | ||||||||||||||||||
1833 | QQMLJS_DECLARE_AST_NODE(CaseBlock) | - | ||||||||||||||||||
1834 | - | |||||||||||||||||||
1835 | CaseBlock(CaseClauses *c, DefaultClause *d = nullptr, CaseClauses *r = nullptr): | - | ||||||||||||||||||
1836 | clauses (c), defaultClause (d), moreClauses (r) | - | ||||||||||||||||||
1837 | { kind = K; } executed 1446 times by 7 tests: end of block Executed by:
| 1446 | ||||||||||||||||||
1838 | - | |||||||||||||||||||
1839 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1840 | - | |||||||||||||||||||
1841 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1842 | { return lbraceToken; } executed 2433 times by 7 tests: return lbraceToken; Executed by:
| 2433 | ||||||||||||||||||
1843 | - | |||||||||||||||||||
1844 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1845 | { return rbraceToken; } executed 1540 times by 1 test: return rbraceToken; Executed by:
| 1540 | ||||||||||||||||||
1846 | - | |||||||||||||||||||
1847 | // attributes | - | ||||||||||||||||||
1848 | CaseClauses *clauses; | - | ||||||||||||||||||
1849 | DefaultClause *defaultClause; | - | ||||||||||||||||||
1850 | CaseClauses *moreClauses; | - | ||||||||||||||||||
1851 | SourceLocation lbraceToken; | - | ||||||||||||||||||
1852 | SourceLocation rbraceToken; | - | ||||||||||||||||||
1853 | }; | - | ||||||||||||||||||
1854 | - | |||||||||||||||||||
1855 | class QML_PARSER_EXPORT SwitchStatement: public Statement | - | ||||||||||||||||||
1856 | { | - | ||||||||||||||||||
1857 | public: | - | ||||||||||||||||||
1858 | QQMLJS_DECLARE_AST_NODE(SwitchStatement) | - | ||||||||||||||||||
1859 | - | |||||||||||||||||||
1860 | SwitchStatement(ExpressionNode *e, CaseBlock *b): | - | ||||||||||||||||||
1861 | expression (e), block (b) | - | ||||||||||||||||||
1862 | { kind = K; } executed 1445 times by 7 tests: end of block Executed by:
| 1445 | ||||||||||||||||||
1863 | - | |||||||||||||||||||
1864 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1865 | - | |||||||||||||||||||
1866 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1867 | { return switchToken; } executed 3253 times by 7 tests: return switchToken; Executed by:
| 3253 | ||||||||||||||||||
1868 | - | |||||||||||||||||||
1869 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1870 | { return block->rbraceToken; } executed 3315 times by 4 tests: return block->rbraceToken; Executed by:
| 3315 | ||||||||||||||||||
1871 | - | |||||||||||||||||||
1872 | // attributes | - | ||||||||||||||||||
1873 | ExpressionNode *expression; | - | ||||||||||||||||||
1874 | CaseBlock *block; | - | ||||||||||||||||||
1875 | SourceLocation switchToken; | - | ||||||||||||||||||
1876 | SourceLocation lparenToken; | - | ||||||||||||||||||
1877 | SourceLocation rparenToken; | - | ||||||||||||||||||
1878 | }; | - | ||||||||||||||||||
1879 | - | |||||||||||||||||||
1880 | class QML_PARSER_EXPORT CaseClause: public Node | - | ||||||||||||||||||
1881 | { | - | ||||||||||||||||||
1882 | public: | - | ||||||||||||||||||
1883 | QQMLJS_DECLARE_AST_NODE(CaseClause) | - | ||||||||||||||||||
1884 | - | |||||||||||||||||||
1885 | CaseClause(ExpressionNode *e, StatementList *slist): | - | ||||||||||||||||||
1886 | expression (e), statements (slist) | - | ||||||||||||||||||
1887 | { kind = K; } executed 121788 times by 7 tests: end of block Executed by:
| 121788 | ||||||||||||||||||
1888 | - | |||||||||||||||||||
1889 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1890 | - | |||||||||||||||||||
1891 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1892 | { return caseToken; } executed 167672 times by 1 test: return caseToken; Executed by:
| 167672 | ||||||||||||||||||
1893 | - | |||||||||||||||||||
1894 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1895 | { return statements ? statements->lastSourceLocation() : colonToken; } executed 167672 times by 1 test: return statements ? statements->lastSourceLocation() : colonToken; Executed by:
| 167672 | ||||||||||||||||||
1896 | - | |||||||||||||||||||
1897 | // attributes | - | ||||||||||||||||||
1898 | ExpressionNode *expression; | - | ||||||||||||||||||
1899 | StatementList *statements; | - | ||||||||||||||||||
1900 | SourceLocation caseToken; | - | ||||||||||||||||||
1901 | SourceLocation colonToken; | - | ||||||||||||||||||
1902 | }; | - | ||||||||||||||||||
1903 | - | |||||||||||||||||||
1904 | class QML_PARSER_EXPORT CaseClauses: public Node | - | ||||||||||||||||||
1905 | { | - | ||||||||||||||||||
1906 | public: | - | ||||||||||||||||||
1907 | QQMLJS_DECLARE_AST_NODE(CaseClauses) | - | ||||||||||||||||||
1908 | - | |||||||||||||||||||
1909 | CaseClauses(CaseClause *c): | - | ||||||||||||||||||
1910 | clause (c), next (this) | - | ||||||||||||||||||
1911 | { kind = K; } executed 1313 times by 7 tests: end of block Executed by:
| 1313 | ||||||||||||||||||
1912 | - | |||||||||||||||||||
1913 | CaseClauses(CaseClauses *previous, CaseClause *c): | - | ||||||||||||||||||
1914 | clause (c) | - | ||||||||||||||||||
1915 | { | - | ||||||||||||||||||
1916 | kind = K; | - | ||||||||||||||||||
1917 | next = previous->next; | - | ||||||||||||||||||
1918 | previous->next = this; | - | ||||||||||||||||||
1919 | } executed 120479 times by 7 tests: end of block Executed by:
| 120479 | ||||||||||||||||||
1920 | - | |||||||||||||||||||
1921 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1922 | - | |||||||||||||||||||
1923 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1924 | { return clause->firstSourceLocation(); } executed 41334 times by 1 test: return clause->firstSourceLocation(); Executed by:
| 41334 | ||||||||||||||||||
1925 | - | |||||||||||||||||||
1926 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1927 | { return next ? next->lastSourceLocation() : clause->lastSourceLocation(); } executed 330597318 times by 1 test: return next ? next->lastSourceLocation() : clause->lastSourceLocation(); Executed by:
| 330597318 | ||||||||||||||||||
1928 | - | |||||||||||||||||||
1929 | inline CaseClauses *finish () | - | ||||||||||||||||||
1930 | { | - | ||||||||||||||||||
1931 | CaseClauses *front = next; | - | ||||||||||||||||||
1932 | next = nullptr; | - | ||||||||||||||||||
1933 | return front; executed 1309 times by 7 tests: return front; Executed by:
| 1309 | ||||||||||||||||||
1934 | } | - | ||||||||||||||||||
1935 | - | |||||||||||||||||||
1936 | //attributes | - | ||||||||||||||||||
1937 | CaseClause *clause; | - | ||||||||||||||||||
1938 | CaseClauses *next; | - | ||||||||||||||||||
1939 | }; | - | ||||||||||||||||||
1940 | - | |||||||||||||||||||
1941 | class QML_PARSER_EXPORT DefaultClause: public Node | - | ||||||||||||||||||
1942 | { | - | ||||||||||||||||||
1943 | public: | - | ||||||||||||||||||
1944 | QQMLJS_DECLARE_AST_NODE(DefaultClause) | - | ||||||||||||||||||
1945 | - | |||||||||||||||||||
1946 | DefaultClause(StatementList *slist): | - | ||||||||||||||||||
1947 | statements (slist) | - | ||||||||||||||||||
1948 | { kind = K; } executed 974 times by 7 tests: end of block Executed by:
| 974 | ||||||||||||||||||
1949 | - | |||||||||||||||||||
1950 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1951 | - | |||||||||||||||||||
1952 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1953 | { return defaultToken; } executed 834 times by 1 test: return defaultToken; Executed by:
| 834 | ||||||||||||||||||
1954 | - | |||||||||||||||||||
1955 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1956 | { return statements ? statements->lastSourceLocation() : colonToken; } executed 834 times by 1 test: return statements ? statements->lastSourceLocation() : colonToken; Executed by:
| 834 | ||||||||||||||||||
1957 | - | |||||||||||||||||||
1958 | // attributes | - | ||||||||||||||||||
1959 | StatementList *statements; | - | ||||||||||||||||||
1960 | SourceLocation defaultToken; | - | ||||||||||||||||||
1961 | SourceLocation colonToken; | - | ||||||||||||||||||
1962 | }; | - | ||||||||||||||||||
1963 | - | |||||||||||||||||||
1964 | class QML_PARSER_EXPORT LabelledStatement: public Statement | - | ||||||||||||||||||
1965 | { | - | ||||||||||||||||||
1966 | public: | - | ||||||||||||||||||
1967 | QQMLJS_DECLARE_AST_NODE(LabelledStatement) | - | ||||||||||||||||||
1968 | - | |||||||||||||||||||
1969 | LabelledStatement(const QStringRef &l, Statement *stmt): | - | ||||||||||||||||||
1970 | label (l), statement (stmt) | - | ||||||||||||||||||
1971 | { kind = K; } executed 1353 times by 6 tests: end of block Executed by:
| 1353 | ||||||||||||||||||
1972 | - | |||||||||||||||||||
1973 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1974 | - | |||||||||||||||||||
1975 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1976 | { return identifierToken; } executed 2624 times by 6 tests: return identifierToken; Executed by:
| 2624 | ||||||||||||||||||
1977 | - | |||||||||||||||||||
1978 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
1979 | { return statement->lastSourceLocation(); } executed 1778 times by 4 tests: return statement->lastSourceLocation(); Executed by:
| 1778 | ||||||||||||||||||
1980 | - | |||||||||||||||||||
1981 | // attributes | - | ||||||||||||||||||
1982 | QStringRef label; | - | ||||||||||||||||||
1983 | Statement *statement; | - | ||||||||||||||||||
1984 | SourceLocation identifierToken; | - | ||||||||||||||||||
1985 | SourceLocation colonToken; | - | ||||||||||||||||||
1986 | }; | - | ||||||||||||||||||
1987 | - | |||||||||||||||||||
1988 | class QML_PARSER_EXPORT ThrowStatement: public Statement | - | ||||||||||||||||||
1989 | { | - | ||||||||||||||||||
1990 | public: | - | ||||||||||||||||||
1991 | QQMLJS_DECLARE_AST_NODE(ThrowStatement) | - | ||||||||||||||||||
1992 | - | |||||||||||||||||||
1993 | ThrowStatement(ExpressionNode *e): | - | ||||||||||||||||||
1994 | expression (e) { kind = K; } executed 118026 times by 14 tests: end of block Executed by:
| 118026 | ||||||||||||||||||
1995 | - | |||||||||||||||||||
1996 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
1997 | - | |||||||||||||||||||
1998 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
1999 | { return throwToken; } executed 135379 times by 14 tests: return throwToken; Executed by:
| 135379 | ||||||||||||||||||
2000 | - | |||||||||||||||||||
2001 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2002 | { return semicolonToken; } executed 36758 times by 4 tests: return semicolonToken; Executed by:
| 36758 | ||||||||||||||||||
2003 | - | |||||||||||||||||||
2004 | // attributes | - | ||||||||||||||||||
2005 | ExpressionNode *expression; | - | ||||||||||||||||||
2006 | SourceLocation throwToken; | - | ||||||||||||||||||
2007 | SourceLocation semicolonToken; | - | ||||||||||||||||||
2008 | }; | - | ||||||||||||||||||
2009 | - | |||||||||||||||||||
2010 | class QML_PARSER_EXPORT Catch: public Node | - | ||||||||||||||||||
2011 | { | - | ||||||||||||||||||
2012 | public: | - | ||||||||||||||||||
2013 | QQMLJS_DECLARE_AST_NODE(Catch) | - | ||||||||||||||||||
2014 | - | |||||||||||||||||||
2015 | Catch(PatternElement *p, Block *stmt) | - | ||||||||||||||||||
2016 | : patternElement(p), statement(stmt) | - | ||||||||||||||||||
2017 | { kind = K; } executed 123846 times by 22 tests: end of block Executed by:
| 123846 | ||||||||||||||||||
2018 | - | |||||||||||||||||||
2019 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2020 | - | |||||||||||||||||||
2021 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2022 | { return catchToken; } executed 137443 times by 22 tests: return catchToken; Executed by:
| 137443 | ||||||||||||||||||
2023 | - | |||||||||||||||||||
2024 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2025 | { return statement->lastSourceLocation(); } executed 23128 times by 1 test: return statement->lastSourceLocation(); Executed by:
| 23128 | ||||||||||||||||||
2026 | - | |||||||||||||||||||
2027 | // attributes | - | ||||||||||||||||||
2028 | PatternElement *patternElement; | - | ||||||||||||||||||
2029 | Block *statement; | - | ||||||||||||||||||
2030 | SourceLocation catchToken; | - | ||||||||||||||||||
2031 | SourceLocation lparenToken; | - | ||||||||||||||||||
2032 | SourceLocation identifierToken; | - | ||||||||||||||||||
2033 | SourceLocation rparenToken; | - | ||||||||||||||||||
2034 | }; | - | ||||||||||||||||||
2035 | - | |||||||||||||||||||
2036 | class QML_PARSER_EXPORT Finally: public Node | - | ||||||||||||||||||
2037 | { | - | ||||||||||||||||||
2038 | public: | - | ||||||||||||||||||
2039 | QQMLJS_DECLARE_AST_NODE(Finally) | - | ||||||||||||||||||
2040 | - | |||||||||||||||||||
2041 | Finally(Block *stmt): | - | ||||||||||||||||||
2042 | statement (stmt) | - | ||||||||||||||||||
2043 | { kind = K; } executed 1487 times by 6 tests: end of block Executed by:
| 1487 | ||||||||||||||||||
2044 | - | |||||||||||||||||||
2045 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2046 | - | |||||||||||||||||||
2047 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2048 | { return finallyToken; } executed 1896 times by 1 test: return finallyToken; Executed by:
| 1896 | ||||||||||||||||||
2049 | - | |||||||||||||||||||
2050 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2051 | { return statement ? statement->lastSourceLocation() : finallyToken; } executed 1896 times by 1 test: return statement ? statement->lastSourceLocation() : finallyToken; Executed by:
| 1896 | ||||||||||||||||||
2052 | - | |||||||||||||||||||
2053 | // attributes | - | ||||||||||||||||||
2054 | Block *statement; | - | ||||||||||||||||||
2055 | SourceLocation finallyToken; | - | ||||||||||||||||||
2056 | }; | - | ||||||||||||||||||
2057 | - | |||||||||||||||||||
2058 | class QML_PARSER_EXPORT TryStatement: public Statement | - | ||||||||||||||||||
2059 | { | - | ||||||||||||||||||
2060 | public: | - | ||||||||||||||||||
2061 | QQMLJS_DECLARE_AST_NODE(TryStatement) | - | ||||||||||||||||||
2062 | - | |||||||||||||||||||
2063 | TryStatement(Statement *stmt, Catch *c, Finally *f): | - | ||||||||||||||||||
2064 | statement (stmt), catchExpression (c), finallyExpression (f) | - | ||||||||||||||||||
2065 | { kind = K; } executed 887 times by 5 tests: end of block Executed by:
| 887 | ||||||||||||||||||
2066 | - | |||||||||||||||||||
2067 | TryStatement(Statement *stmt, Finally *f): | - | ||||||||||||||||||
2068 | statement (stmt), catchExpression (nullptr), finallyExpression (f) | - | ||||||||||||||||||
2069 | { kind = K; } executed 600 times by 5 tests: end of block Executed by:
| 600 | ||||||||||||||||||
2070 | - | |||||||||||||||||||
2071 | TryStatement(Statement *stmt, Catch *c): | - | ||||||||||||||||||
2072 | statement (stmt), catchExpression (c), finallyExpression (nullptr) | - | ||||||||||||||||||
2073 | { kind = K; } executed 124469 times by 22 tests: end of block Executed by:
| 124469 | ||||||||||||||||||
2074 | - | |||||||||||||||||||
2075 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2076 | - | |||||||||||||||||||
2077 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2078 | { return tryToken; } executed 144551 times by 22 tests: return tryToken; Executed by:
| 144551 | ||||||||||||||||||
2079 | - | |||||||||||||||||||
2080 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2081 | { | - | ||||||||||||||||||
2082 | if (finallyExpression)
| 3738-35575 | ||||||||||||||||||
2083 | return finallyExpression->statement->rbraceToken; executed 3738 times by 4 tests: return finallyExpression->statement->rbraceToken; Executed by:
| 3738 | ||||||||||||||||||
2084 | else if (catchExpression)
| 0-35572 | ||||||||||||||||||
2085 | return catchExpression->statement->rbraceToken; executed 35572 times by 5 tests: return catchExpression->statement->rbraceToken; Executed by:
| 35572 | ||||||||||||||||||
2086 | - | |||||||||||||||||||
2087 | return statement->lastSourceLocation(); never executed: return statement->lastSourceLocation(); | 0 | ||||||||||||||||||
2088 | } | - | ||||||||||||||||||
2089 | - | |||||||||||||||||||
2090 | // attributes | - | ||||||||||||||||||
2091 | Statement *statement; | - | ||||||||||||||||||
2092 | Catch *catchExpression; | - | ||||||||||||||||||
2093 | Finally *finallyExpression; | - | ||||||||||||||||||
2094 | SourceLocation tryToken; | - | ||||||||||||||||||
2095 | }; | - | ||||||||||||||||||
2096 | - | |||||||||||||||||||
2097 | class QML_PARSER_EXPORT FunctionExpression: public ExpressionNode | - | ||||||||||||||||||
2098 | { | - | ||||||||||||||||||
2099 | public: | - | ||||||||||||||||||
2100 | QQMLJS_DECLARE_AST_NODE(FunctionExpression) | - | ||||||||||||||||||
2101 | - | |||||||||||||||||||
2102 | FunctionExpression(const QStringRef &n, FormalParameterList *f, StatementList *b): | - | ||||||||||||||||||
2103 | name (n), formals (f), body (b) | - | ||||||||||||||||||
2104 | { kind = K; } executed 1195709 times by 99 tests: end of block Executed by:
| 1195709 | ||||||||||||||||||
2105 | - | |||||||||||||||||||
2106 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2107 | - | |||||||||||||||||||
2108 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2109 | { return functionToken; } executed 2492096 times by 99 tests: return functionToken; Executed by:
| 2492096 | ||||||||||||||||||
2110 | - | |||||||||||||||||||
2111 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2112 | { return rbraceToken; } executed 1599660 times by 99 tests: return rbraceToken; Executed by:
| 1599660 | ||||||||||||||||||
2113 | - | |||||||||||||||||||
2114 | FunctionExpression *asFunctionDefinition() override; | - | ||||||||||||||||||
2115 | - | |||||||||||||||||||
2116 | // attributes | - | ||||||||||||||||||
2117 | QStringRef name; | - | ||||||||||||||||||
2118 | bool isArrowFunction = false; | - | ||||||||||||||||||
2119 | bool isGenerator = false; | - | ||||||||||||||||||
2120 | FormalParameterList *formals; | - | ||||||||||||||||||
2121 | StatementList *body; | - | ||||||||||||||||||
2122 | SourceLocation functionToken; | - | ||||||||||||||||||
2123 | SourceLocation identifierToken; | - | ||||||||||||||||||
2124 | SourceLocation lparenToken; | - | ||||||||||||||||||
2125 | SourceLocation rparenToken; | - | ||||||||||||||||||
2126 | SourceLocation lbraceToken; | - | ||||||||||||||||||
2127 | SourceLocation rbraceToken; | - | ||||||||||||||||||
2128 | }; | - | ||||||||||||||||||
2129 | - | |||||||||||||||||||
2130 | class QML_PARSER_EXPORT FunctionDeclaration: public FunctionExpression | - | ||||||||||||||||||
2131 | { | - | ||||||||||||||||||
2132 | public: | - | ||||||||||||||||||
2133 | QQMLJS_DECLARE_AST_NODE(FunctionDeclaration) | - | ||||||||||||||||||
2134 | - | |||||||||||||||||||
2135 | FunctionDeclaration(const QStringRef &n, FormalParameterList *f, StatementList *b): | - | ||||||||||||||||||
2136 | FunctionExpression(n, f, b) | - | ||||||||||||||||||
2137 | { kind = K; } executed 325827 times by 97 tests: end of block Executed by:
| 325827 | ||||||||||||||||||
2138 | - | |||||||||||||||||||
2139 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2140 | }; | - | ||||||||||||||||||
2141 | - | |||||||||||||||||||
2142 | class QML_PARSER_EXPORT FormalParameterList: public Node | - | ||||||||||||||||||
2143 | { | - | ||||||||||||||||||
2144 | public: | - | ||||||||||||||||||
2145 | QQMLJS_DECLARE_AST_NODE(FormalParameterList) | - | ||||||||||||||||||
2146 | - | |||||||||||||||||||
2147 | FormalParameterList(FormalParameterList *previous, PatternElement *e) | - | ||||||||||||||||||
2148 | : element(e) | - | ||||||||||||||||||
2149 | { | - | ||||||||||||||||||
2150 | kind = K; | - | ||||||||||||||||||
2151 | if (previous) {
| 875796-1014992 | ||||||||||||||||||
2152 | next = previous->next; | - | ||||||||||||||||||
2153 | previous->next = this; | - | ||||||||||||||||||
2154 | } else { executed 1014665 times by 30 tests: end of block Executed by:
| 1014665 | ||||||||||||||||||
2155 | next = this; | - | ||||||||||||||||||
2156 | } executed 874118 times by 59 tests: end of block Executed by:
| 874118 | ||||||||||||||||||
2157 | } | - | ||||||||||||||||||
2158 | - | |||||||||||||||||||
2159 | FormalParameterList *append(FormalParameterList *n) { | - | ||||||||||||||||||
2160 | n->next = next; | - | ||||||||||||||||||
2161 | next = n; | - | ||||||||||||||||||
2162 | return n; never executed: return n; | 0 | ||||||||||||||||||
2163 | } | - | ||||||||||||||||||
2164 | - | |||||||||||||||||||
2165 | bool isSimpleParameterList() | - | ||||||||||||||||||
2166 | { | - | ||||||||||||||||||
2167 | AST::FormalParameterList *formals = this; | - | ||||||||||||||||||
2168 | while (formals) {
| 6753-19788 | ||||||||||||||||||
2169 | PatternElement *e = formals->element; | - | ||||||||||||||||||
2170 | if (e && e->type == PatternElement::RestElement)
| 0-19789 | ||||||||||||||||||
2171 | return false; executed 18 times by 1 test: return false; Executed by:
| 18 | ||||||||||||||||||
2172 | if (e && (e->initializer || e->bindingTarget))
| 0-19793 | ||||||||||||||||||
2173 | return false; executed 80 times by 1 test: return false; Executed by:
| 80 | ||||||||||||||||||
2174 | formals = formals->next; | - | ||||||||||||||||||
2175 | } executed 19720 times by 12 tests: end of block Executed by:
| 19720 | ||||||||||||||||||
2176 | return true; executed 6748 times by 12 tests: return true; Executed by:
| 6748 | ||||||||||||||||||
2177 | } | - | ||||||||||||||||||
2178 | - | |||||||||||||||||||
2179 | int length() | - | ||||||||||||||||||
2180 | { | - | ||||||||||||||||||
2181 | // the length property of Function objects | - | ||||||||||||||||||
2182 | int l = 0; | - | ||||||||||||||||||
2183 | AST::FormalParameterList *formals = this; | - | ||||||||||||||||||
2184 | while (formals) {
| 802691-1759163 | ||||||||||||||||||
2185 | PatternElement *e = formals->element; | - | ||||||||||||||||||
2186 | if (!e || e->initializer)
| 0-1759321 | ||||||||||||||||||
2187 | break; executed 5880 times by 1 test: break; Executed by:
| 5880 | ||||||||||||||||||
2188 | if (e->type == PatternElement::RestElement)
| 230-1754371 | ||||||||||||||||||
2189 | break; executed 230 times by 1 test: break; Executed by:
| 230 | ||||||||||||||||||
2190 | ++l; | - | ||||||||||||||||||
2191 | formals = formals->next; | - | ||||||||||||||||||
2192 | } executed 1754341 times by 58 tests: end of block Executed by:
| 1754341 | ||||||||||||||||||
2193 | return l; executed 809070 times by 58 tests: return l; Executed by:
| 809070 | ||||||||||||||||||
2194 | } | - | ||||||||||||||||||
2195 | - | |||||||||||||||||||
2196 | bool containsName(const QString &name) const { | - | ||||||||||||||||||
2197 | for (const FormalParameterList *it = this; it; it = it->next) {
| 318749-745000 | ||||||||||||||||||
2198 | PatternElement *b = it->element; | - | ||||||||||||||||||
2199 | // ### handle binding patterns | - | ||||||||||||||||||
2200 | if (b && b->bindingIdentifier == name)
| 0-745343 | ||||||||||||||||||
2201 | return true; executed 32 times by 3 tests: return true; Executed by:
| 32 | ||||||||||||||||||
2202 | } executed 745291 times by 29 tests: end of block Executed by:
| 745291 | ||||||||||||||||||
2203 | return false; executed 318825 times by 29 tests: return false; Executed by:
| 318825 | ||||||||||||||||||
2204 | } | - | ||||||||||||||||||
2205 | - | |||||||||||||||||||
2206 | QStringList formals() const; | - | ||||||||||||||||||
2207 | - | |||||||||||||||||||
2208 | QStringList boundNames() const; | - | ||||||||||||||||||
2209 | - | |||||||||||||||||||
2210 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2211 | - | |||||||||||||||||||
2212 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2213 | { return element->firstSourceLocation(); } executed 116313 times by 2 tests: return element->firstSourceLocation(); Executed by:
| 116313 | ||||||||||||||||||
2214 | - | |||||||||||||||||||
2215 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2216 | { return next ? next->lastSourceLocation() : element->lastSourceLocation(); } executed 195912 times by 1 test: return next ? next->lastSourceLocation() : element->lastSourceLocation(); Executed by:
| 195912 | ||||||||||||||||||
2217 | - | |||||||||||||||||||
2218 | FormalParameterList *finish(MemoryPool *pool); | - | ||||||||||||||||||
2219 | - | |||||||||||||||||||
2220 | // attributes | - | ||||||||||||||||||
2221 | PatternElement *element = nullptr; | - | ||||||||||||||||||
2222 | FormalParameterList *next; | - | ||||||||||||||||||
2223 | }; | - | ||||||||||||||||||
2224 | - | |||||||||||||||||||
2225 | class QML_PARSER_EXPORT ClassExpression : public ExpressionNode | - | ||||||||||||||||||
2226 | { | - | ||||||||||||||||||
2227 | public: | - | ||||||||||||||||||
2228 | QQMLJS_DECLARE_AST_NODE(ClassExpression) | - | ||||||||||||||||||
2229 | - | |||||||||||||||||||
2230 | ClassExpression(const QStringRef &n, ExpressionNode *heritage, ClassElementList *elements) | - | ||||||||||||||||||
2231 | : name(n), heritage(heritage), elements(elements) | - | ||||||||||||||||||
2232 | { kind = K; } executed 15657 times by 2 tests: end of block Executed by:
| 15657 | ||||||||||||||||||
2233 | - | |||||||||||||||||||
2234 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2235 | - | |||||||||||||||||||
2236 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2237 | { return classToken; } executed 28233 times by 2 tests: return classToken; Executed by:
| 28233 | ||||||||||||||||||
2238 | - | |||||||||||||||||||
2239 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2240 | { return rbraceToken; } executed 33843 times by 2 tests: return rbraceToken; Executed by:
| 33843 | ||||||||||||||||||
2241 | - | |||||||||||||||||||
2242 | ClassExpression *asClassDefinition() override; | - | ||||||||||||||||||
2243 | - | |||||||||||||||||||
2244 | // attributes | - | ||||||||||||||||||
2245 | QStringRef name; | - | ||||||||||||||||||
2246 | ExpressionNode *heritage; | - | ||||||||||||||||||
2247 | ClassElementList *elements; | - | ||||||||||||||||||
2248 | SourceLocation classToken; | - | ||||||||||||||||||
2249 | SourceLocation identifierToken; | - | ||||||||||||||||||
2250 | SourceLocation lbraceToken; | - | ||||||||||||||||||
2251 | SourceLocation rbraceToken; | - | ||||||||||||||||||
2252 | }; | - | ||||||||||||||||||
2253 | - | |||||||||||||||||||
2254 | class QML_PARSER_EXPORT ClassDeclaration: public ClassExpression | - | ||||||||||||||||||
2255 | { | - | ||||||||||||||||||
2256 | public: | - | ||||||||||||||||||
2257 | QQMLJS_DECLARE_AST_NODE(ClassDeclaration) | - | ||||||||||||||||||
2258 | - | |||||||||||||||||||
2259 | ClassDeclaration(const QStringRef &n, ExpressionNode *heritage, ClassElementList *elements) | - | ||||||||||||||||||
2260 | : ClassExpression(n, heritage, elements) | - | ||||||||||||||||||
2261 | { kind = K; } executed 8326 times by 2 tests: end of block Executed by:
| 8326 | ||||||||||||||||||
2262 | - | |||||||||||||||||||
2263 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2264 | }; | - | ||||||||||||||||||
2265 | - | |||||||||||||||||||
2266 | - | |||||||||||||||||||
2267 | class QML_PARSER_EXPORT ClassElementList : public Node | - | ||||||||||||||||||
2268 | { | - | ||||||||||||||||||
2269 | public: | - | ||||||||||||||||||
2270 | QQMLJS_DECLARE_AST_NODE(ClassElementList) | - | ||||||||||||||||||
2271 | - | |||||||||||||||||||
2272 | ClassElementList(PatternProperty *property, bool isStatic) | - | ||||||||||||||||||
2273 | : isStatic(isStatic), property(property) | - | ||||||||||||||||||
2274 | { | - | ||||||||||||||||||
2275 | kind = K; | - | ||||||||||||||||||
2276 | next = this; | - | ||||||||||||||||||
2277 | } executed 14484 times by 2 tests: end of block Executed by:
| 14484 | ||||||||||||||||||
2278 | - | |||||||||||||||||||
2279 | ClassElementList *append(ClassElementList *n) { | - | ||||||||||||||||||
2280 | n->next = next; | - | ||||||||||||||||||
2281 | next = n; | - | ||||||||||||||||||
2282 | return n; executed 1099 times by 2 tests: return n; Executed by:
| 1099 | ||||||||||||||||||
2283 | } | - | ||||||||||||||||||
2284 | - | |||||||||||||||||||
2285 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2286 | - | |||||||||||||||||||
2287 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2288 | { return property->firstSourceLocation(); } executed 13900 times by 1 test: return property->firstSourceLocation(); Executed by:
| 13900 | ||||||||||||||||||
2289 | - | |||||||||||||||||||
2290 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2291 | { | - | ||||||||||||||||||
2292 | if (next)
| 2456-13900 | ||||||||||||||||||
2293 | return next->lastSourceLocation(); executed 2456 times by 1 test: return next->lastSourceLocation(); Executed by:
| 2456 | ||||||||||||||||||
2294 | return property->lastSourceLocation(); executed 13900 times by 1 test: return property->lastSourceLocation(); Executed by:
| 13900 | ||||||||||||||||||
2295 | } | - | ||||||||||||||||||
2296 | - | |||||||||||||||||||
2297 | ClassElementList *finish(); | - | ||||||||||||||||||
2298 | - | |||||||||||||||||||
2299 | bool isStatic; | - | ||||||||||||||||||
2300 | ClassElementList *next; | - | ||||||||||||||||||
2301 | PatternProperty *property; | - | ||||||||||||||||||
2302 | }; | - | ||||||||||||||||||
2303 | - | |||||||||||||||||||
2304 | class QML_PARSER_EXPORT Program: public Node | - | ||||||||||||||||||
2305 | { | - | ||||||||||||||||||
2306 | public: | - | ||||||||||||||||||
2307 | QQMLJS_DECLARE_AST_NODE(Program) | - | ||||||||||||||||||
2308 | - | |||||||||||||||||||
2309 | Program(StatementList *statements) | - | ||||||||||||||||||
2310 | : statements(statements) | - | ||||||||||||||||||
2311 | { kind = K; } executed 2344878 times by 41 tests: end of block Executed by:
| 2344878 | ||||||||||||||||||
2312 | - | |||||||||||||||||||
2313 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2314 | - | |||||||||||||||||||
2315 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2316 | { return statements ? statements->firstSourceLocation() : SourceLocation(); } executed 4626422 times by 41 tests: return statements ? statements->firstSourceLocation() : SourceLocation(); Executed by:
| 4626422 | ||||||||||||||||||
2317 | - | |||||||||||||||||||
2318 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2319 | { return statements ? statements->lastSourceLocation() : SourceLocation(); } executed 2338483 times by 41 tests: return statements ? statements->lastSourceLocation() : SourceLocation(); Executed by:
| 2338483 | ||||||||||||||||||
2320 | - | |||||||||||||||||||
2321 | // attributes | - | ||||||||||||||||||
2322 | StatementList *statements; | - | ||||||||||||||||||
2323 | }; | - | ||||||||||||||||||
2324 | - | |||||||||||||||||||
2325 | class QML_PARSER_EXPORT DebuggerStatement: public Statement | - | ||||||||||||||||||
2326 | { | - | ||||||||||||||||||
2327 | public: | - | ||||||||||||||||||
2328 | QQMLJS_DECLARE_AST_NODE(DebuggerStatement) | - | ||||||||||||||||||
2329 | - | |||||||||||||||||||
2330 | DebuggerStatement() | - | ||||||||||||||||||
2331 | { kind = K; } executed 10 times by 4 tests: end of block Executed by:
| 10 | ||||||||||||||||||
2332 | - | |||||||||||||||||||
2333 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2334 | - | |||||||||||||||||||
2335 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2336 | { return debuggerToken; } executed 6 times by 2 tests: return debuggerToken; Executed by:
| 6 | ||||||||||||||||||
2337 | - | |||||||||||||||||||
2338 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2339 | { return semicolonToken; } executed 24 times by 2 tests: return semicolonToken; Executed by:
| 24 | ||||||||||||||||||
2340 | - | |||||||||||||||||||
2341 | // attributes | - | ||||||||||||||||||
2342 | SourceLocation debuggerToken; | - | ||||||||||||||||||
2343 | SourceLocation semicolonToken; | - | ||||||||||||||||||
2344 | }; | - | ||||||||||||||||||
2345 | - | |||||||||||||||||||
2346 | class QML_PARSER_EXPORT UiQualifiedId: public Node | - | ||||||||||||||||||
2347 | { | - | ||||||||||||||||||
2348 | public: | - | ||||||||||||||||||
2349 | QQMLJS_DECLARE_AST_NODE(UiQualifiedId) | - | ||||||||||||||||||
2350 | - | |||||||||||||||||||
2351 | UiQualifiedId(const QStringRef &name) | - | ||||||||||||||||||
2352 | : next(this), name(name) | - | ||||||||||||||||||
2353 | { kind = K; } executed 426156 times by 143 tests: end of block Executed by:
| 426156 | ||||||||||||||||||
2354 | - | |||||||||||||||||||
2355 | UiQualifiedId(UiQualifiedId *previous, const QStringRef &name) | - | ||||||||||||||||||
2356 | : name(name) | - | ||||||||||||||||||
2357 | { | - | ||||||||||||||||||
2358 | kind = K; | - | ||||||||||||||||||
2359 | next = previous->next; | - | ||||||||||||||||||
2360 | previous->next = this; | - | ||||||||||||||||||
2361 | } executed 23608 times by 116 tests: end of block Executed by:
| 23608 | ||||||||||||||||||
2362 | - | |||||||||||||||||||
2363 | UiQualifiedId *finish() | - | ||||||||||||||||||
2364 | { | - | ||||||||||||||||||
2365 | UiQualifiedId *head = next; | - | ||||||||||||||||||
2366 | next = nullptr; | - | ||||||||||||||||||
2367 | return head; executed 425536 times by 143 tests: return head; Executed by:
| 425536 | ||||||||||||||||||
2368 | } | - | ||||||||||||||||||
2369 | - | |||||||||||||||||||
2370 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2371 | - | |||||||||||||||||||
2372 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2373 | { return identifierToken; } executed 446785 times by 143 tests: return identifierToken; Executed by:
| 446785 | ||||||||||||||||||
2374 | - | |||||||||||||||||||
2375 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2376 | { return next ? next->lastSourceLocation() : identifierToken; } executed 415160 times by 1 test: return next ? next->lastSourceLocation() : identifierToken; Executed by:
| 415160 | ||||||||||||||||||
2377 | - | |||||||||||||||||||
2378 | // attributes | - | ||||||||||||||||||
2379 | UiQualifiedId *next; | - | ||||||||||||||||||
2380 | QStringRef name; | - | ||||||||||||||||||
2381 | SourceLocation identifierToken; | - | ||||||||||||||||||
2382 | }; | - | ||||||||||||||||||
2383 | - | |||||||||||||||||||
2384 | class QML_PARSER_EXPORT UiImport: public Node | - | ||||||||||||||||||
2385 | { | - | ||||||||||||||||||
2386 | public: | - | ||||||||||||||||||
2387 | QQMLJS_DECLARE_AST_NODE(UiImport) | - | ||||||||||||||||||
2388 | - | |||||||||||||||||||
2389 | UiImport(const QStringRef &fileName) | - | ||||||||||||||||||
2390 | : fileName(fileName), importUri(nullptr) | - | ||||||||||||||||||
2391 | { kind = K; } executed 899 times by 25 tests: end of block Executed by:
| 899 | ||||||||||||||||||
2392 | - | |||||||||||||||||||
2393 | UiImport(UiQualifiedId *uri) | - | ||||||||||||||||||
2394 | : importUri(uri) | - | ||||||||||||||||||
2395 | { kind = K; } executed 58516 times by 143 tests: end of block Executed by:
| 58516 | ||||||||||||||||||
2396 | - | |||||||||||||||||||
2397 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2398 | - | |||||||||||||||||||
2399 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2400 | { return importToken; } executed 75456 times by 1 test: return importToken; Executed by:
| 75456 | ||||||||||||||||||
2401 | - | |||||||||||||||||||
2402 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2403 | { return semicolonToken; } executed 60892 times by 1 test: return semicolonToken; Executed by:
| 60892 | ||||||||||||||||||
2404 | - | |||||||||||||||||||
2405 | // attributes | - | ||||||||||||||||||
2406 | QStringRef fileName; | - | ||||||||||||||||||
2407 | UiQualifiedId *importUri; | - | ||||||||||||||||||
2408 | QStringRef importId; | - | ||||||||||||||||||
2409 | SourceLocation importToken; | - | ||||||||||||||||||
2410 | SourceLocation fileNameToken; | - | ||||||||||||||||||
2411 | SourceLocation versionToken; | - | ||||||||||||||||||
2412 | SourceLocation asToken; | - | ||||||||||||||||||
2413 | SourceLocation importIdToken; | - | ||||||||||||||||||
2414 | SourceLocation semicolonToken; | - | ||||||||||||||||||
2415 | }; | - | ||||||||||||||||||
2416 | - | |||||||||||||||||||
2417 | class QML_PARSER_EXPORT UiObjectMember: public Node | - | ||||||||||||||||||
2418 | { | - | ||||||||||||||||||
2419 | public: | - | ||||||||||||||||||
2420 | SourceLocation firstSourceLocation() const override = 0; | - | ||||||||||||||||||
2421 | SourceLocation lastSourceLocation() const override = 0; | - | ||||||||||||||||||
2422 | - | |||||||||||||||||||
2423 | UiObjectMember *uiObjectMemberCast() override; | - | ||||||||||||||||||
2424 | }; | - | ||||||||||||||||||
2425 | - | |||||||||||||||||||
2426 | class QML_PARSER_EXPORT UiObjectMemberList: public Node | - | ||||||||||||||||||
2427 | { | - | ||||||||||||||||||
2428 | public: | - | ||||||||||||||||||
2429 | QQMLJS_DECLARE_AST_NODE(UiObjectMemberList) | - | ||||||||||||||||||
2430 | - | |||||||||||||||||||
2431 | UiObjectMemberList(UiObjectMember *member) | - | ||||||||||||||||||
2432 | : next(this), member(member) | - | ||||||||||||||||||
2433 | { kind = K; } executed 159227 times by 143 tests: end of block Executed by:
| 159227 | ||||||||||||||||||
2434 | - | |||||||||||||||||||
2435 | UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member) | - | ||||||||||||||||||
2436 | : member(member) | - | ||||||||||||||||||
2437 | { | - | ||||||||||||||||||
2438 | kind = K; | - | ||||||||||||||||||
2439 | next = previous->next; | - | ||||||||||||||||||
2440 | previous->next = this; | - | ||||||||||||||||||
2441 | } executed 206171 times by 137 tests: end of block Executed by:
| 206171 | ||||||||||||||||||
2442 | - | |||||||||||||||||||
2443 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2444 | - | |||||||||||||||||||
2445 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2446 | { return member->firstSourceLocation(); } executed 286908 times by 1 test: return member->firstSourceLocation(); Executed by:
| 286908 | ||||||||||||||||||
2447 | - | |||||||||||||||||||
2448 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2449 | { return next ? next->lastSourceLocation() : member->lastSourceLocation(); } executed 4469080 times by 1 test: return next ? next->lastSourceLocation() : member->lastSourceLocation(); Executed by:
| 4469080 | ||||||||||||||||||
2450 | - | |||||||||||||||||||
2451 | UiObjectMemberList *finish() | - | ||||||||||||||||||
2452 | { | - | ||||||||||||||||||
2453 | UiObjectMemberList *head = next; | - | ||||||||||||||||||
2454 | next = nullptr; | - | ||||||||||||||||||
2455 | return head; executed 159219 times by 143 tests: return head; Executed by:
| 159219 | ||||||||||||||||||
2456 | } | - | ||||||||||||||||||
2457 | - | |||||||||||||||||||
2458 | // attributes | - | ||||||||||||||||||
2459 | UiObjectMemberList *next; | - | ||||||||||||||||||
2460 | UiObjectMember *member; | - | ||||||||||||||||||
2461 | }; | - | ||||||||||||||||||
2462 | - | |||||||||||||||||||
2463 | class QML_PARSER_EXPORT UiQualifiedPragmaId: public Node | - | ||||||||||||||||||
2464 | { | - | ||||||||||||||||||
2465 | public: | - | ||||||||||||||||||
2466 | QQMLJS_DECLARE_AST_NODE(UiQualifiedPragmaId) | - | ||||||||||||||||||
2467 | - | |||||||||||||||||||
2468 | UiQualifiedPragmaId(const QStringRef &name) | - | ||||||||||||||||||
2469 | : next(this), name(name) | - | ||||||||||||||||||
2470 | { kind = K; } executed 47 times by 5 tests: end of block Executed by:
| 47 | ||||||||||||||||||
2471 | - | |||||||||||||||||||
2472 | UiQualifiedPragmaId(UiQualifiedPragmaId *previous, const QStringRef &name) | - | ||||||||||||||||||
2473 | : name(name) | - | ||||||||||||||||||
2474 | { | - | ||||||||||||||||||
2475 | kind = K; | - | ||||||||||||||||||
2476 | next = previous->next; | - | ||||||||||||||||||
2477 | previous->next = this; | - | ||||||||||||||||||
2478 | } never executed: end of block | 0 | ||||||||||||||||||
2479 | - | |||||||||||||||||||
2480 | UiQualifiedPragmaId *finish() | - | ||||||||||||||||||
2481 | { | - | ||||||||||||||||||
2482 | UiQualifiedPragmaId *head = next; | - | ||||||||||||||||||
2483 | next = nullptr; | - | ||||||||||||||||||
2484 | return head; executed 47 times by 5 tests: return head; Executed by:
| 47 | ||||||||||||||||||
2485 | } | - | ||||||||||||||||||
2486 | - | |||||||||||||||||||
2487 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2488 | - | |||||||||||||||||||
2489 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2490 | { return identifierToken; } executed 72 times by 1 test: return identifierToken; Executed by:
| 72 | ||||||||||||||||||
2491 | - | |||||||||||||||||||
2492 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2493 | { return next ? next->lastSourceLocation() : identifierToken; } executed 72 times by 1 test: return next ? next->lastSourceLocation() : identifierToken; Executed by:
| 72 | ||||||||||||||||||
2494 | - | |||||||||||||||||||
2495 | // attributes | - | ||||||||||||||||||
2496 | UiQualifiedPragmaId *next; | - | ||||||||||||||||||
2497 | QStringRef name; | - | ||||||||||||||||||
2498 | SourceLocation identifierToken; | - | ||||||||||||||||||
2499 | }; | - | ||||||||||||||||||
2500 | - | |||||||||||||||||||
2501 | class QML_PARSER_EXPORT UiPragma: public Node | - | ||||||||||||||||||
2502 | { | - | ||||||||||||||||||
2503 | public: | - | ||||||||||||||||||
2504 | QQMLJS_DECLARE_AST_NODE(UiPragma) | - | ||||||||||||||||||
2505 | - | |||||||||||||||||||
2506 | UiPragma(UiQualifiedPragmaId *type) | - | ||||||||||||||||||
2507 | : pragmaType(type) | - | ||||||||||||||||||
2508 | { kind = K; } executed 47 times by 5 tests: end of block Executed by:
| 47 | ||||||||||||||||||
2509 | - | |||||||||||||||||||
2510 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2511 | - | |||||||||||||||||||
2512 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2513 | { return pragmaToken; } executed 270 times by 1 test: return pragmaToken; Executed by:
| 270 | ||||||||||||||||||
2514 | - | |||||||||||||||||||
2515 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2516 | { return semicolonToken; } executed 234 times by 1 test: return semicolonToken; Executed by:
| 234 | ||||||||||||||||||
2517 | - | |||||||||||||||||||
2518 | // attributes | - | ||||||||||||||||||
2519 | UiQualifiedPragmaId *pragmaType; | - | ||||||||||||||||||
2520 | SourceLocation pragmaToken; | - | ||||||||||||||||||
2521 | SourceLocation semicolonToken; | - | ||||||||||||||||||
2522 | }; | - | ||||||||||||||||||
2523 | - | |||||||||||||||||||
2524 | class QML_PARSER_EXPORT UiHeaderItemList: public Node | - | ||||||||||||||||||
2525 | { | - | ||||||||||||||||||
2526 | public: | - | ||||||||||||||||||
2527 | QQMLJS_DECLARE_AST_NODE(UiHeaderItemList) | - | ||||||||||||||||||
2528 | - | |||||||||||||||||||
2529 | UiHeaderItemList(UiImport *import) | - | ||||||||||||||||||
2530 | : headerItem(import), next(this) | - | ||||||||||||||||||
2531 | { kind = K; } executed 55891 times by 143 tests: end of block Executed by:
| 55891 | ||||||||||||||||||
2532 | - | |||||||||||||||||||
2533 | UiHeaderItemList(UiPragma *pragma) | - | ||||||||||||||||||
2534 | : headerItem(pragma), next(this) | - | ||||||||||||||||||
2535 | { kind = K; } executed 21 times by 4 tests: end of block Executed by:
| 21 | ||||||||||||||||||
2536 | - | |||||||||||||||||||
2537 | UiHeaderItemList(UiHeaderItemList *previous, UiImport *import) | - | ||||||||||||||||||
2538 | : headerItem(import) | - | ||||||||||||||||||
2539 | { | - | ||||||||||||||||||
2540 | kind = K; | - | ||||||||||||||||||
2541 | next = previous->next; | - | ||||||||||||||||||
2542 | previous->next = this; | - | ||||||||||||||||||
2543 | } executed 3524 times by 90 tests: end of block Executed by:
| 3524 | ||||||||||||||||||
2544 | - | |||||||||||||||||||
2545 | UiHeaderItemList(UiHeaderItemList *previous, UiPragma *pragma) | - | ||||||||||||||||||
2546 | : headerItem(pragma) | - | ||||||||||||||||||
2547 | { | - | ||||||||||||||||||
2548 | kind = K; | - | ||||||||||||||||||
2549 | next = previous->next; | - | ||||||||||||||||||
2550 | previous->next = this; | - | ||||||||||||||||||
2551 | } executed 26 times by 2 tests: end of block Executed by:
| 26 | ||||||||||||||||||
2552 | - | |||||||||||||||||||
2553 | UiHeaderItemList *finish() | - | ||||||||||||||||||
2554 | { | - | ||||||||||||||||||
2555 | UiHeaderItemList *head = next; | - | ||||||||||||||||||
2556 | next = nullptr; | - | ||||||||||||||||||
2557 | return head; executed 55912 times by 143 tests: return head; Executed by:
| 55912 | ||||||||||||||||||
2558 | } | - | ||||||||||||||||||
2559 | - | |||||||||||||||||||
2560 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2561 | - | |||||||||||||||||||
2562 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2563 | { return headerItem->firstSourceLocation(); } executed 46764 times by 1 test: return headerItem->firstSourceLocation(); Executed by:
| 46764 | ||||||||||||||||||
2564 | - | |||||||||||||||||||
2565 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2566 | { return next ? next->lastSourceLocation() : headerItem->lastSourceLocation(); } executed 46628 times by 1 test: return next ? next->lastSourceLocation() : headerItem->lastSourceLocation(); Executed by:
| 46628 | ||||||||||||||||||
2567 | - | |||||||||||||||||||
2568 | // attributes | - | ||||||||||||||||||
2569 | Node *headerItem; | - | ||||||||||||||||||
2570 | UiHeaderItemList *next; | - | ||||||||||||||||||
2571 | }; | - | ||||||||||||||||||
2572 | - | |||||||||||||||||||
2573 | class QML_PARSER_EXPORT UiProgram: public Node | - | ||||||||||||||||||
2574 | { | - | ||||||||||||||||||
2575 | public: | - | ||||||||||||||||||
2576 | QQMLJS_DECLARE_AST_NODE(UiProgram) | - | ||||||||||||||||||
2577 | - | |||||||||||||||||||
2578 | UiProgram(UiHeaderItemList *headers, UiObjectMemberList *members) | - | ||||||||||||||||||
2579 | : headers(headers), members(members) | - | ||||||||||||||||||
2580 | { kind = K; } executed 55904 times by 143 tests: end of block Executed by:
| 55904 | ||||||||||||||||||
2581 | - | |||||||||||||||||||
2582 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2583 | - | |||||||||||||||||||
2584 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2585 | { | - | ||||||||||||||||||
2586 | if (headers)
| 26-14600 | ||||||||||||||||||
2587 | return headers->firstSourceLocation(); executed 14600 times by 1 test: return headers->firstSourceLocation(); Executed by:
| 14600 | ||||||||||||||||||
2588 | else if (members)
| 0-26 | ||||||||||||||||||
2589 | return members->firstSourceLocation(); executed 26 times by 1 test: return members->firstSourceLocation(); Executed by:
| 26 | ||||||||||||||||||
2590 | return SourceLocation(); never executed: return SourceLocation(); | 0 | ||||||||||||||||||
2591 | } | - | ||||||||||||||||||
2592 | - | |||||||||||||||||||
2593 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2594 | { | - | ||||||||||||||||||
2595 | if (members)
| 0-14626 | ||||||||||||||||||
2596 | return members->lastSourceLocation(); executed 14626 times by 1 test: return members->lastSourceLocation(); Executed by:
| 14626 | ||||||||||||||||||
2597 | else if (headers)
| 0 | ||||||||||||||||||
2598 | return headers->lastSourceLocation(); never executed: return headers->lastSourceLocation(); | 0 | ||||||||||||||||||
2599 | return SourceLocation(); never executed: return SourceLocation(); | 0 | ||||||||||||||||||
2600 | } | - | ||||||||||||||||||
2601 | - | |||||||||||||||||||
2602 | // attributes | - | ||||||||||||||||||
2603 | UiHeaderItemList *headers; | - | ||||||||||||||||||
2604 | UiObjectMemberList *members; | - | ||||||||||||||||||
2605 | }; | - | ||||||||||||||||||
2606 | - | |||||||||||||||||||
2607 | class QML_PARSER_EXPORT UiArrayMemberList: public Node | - | ||||||||||||||||||
2608 | { | - | ||||||||||||||||||
2609 | public: | - | ||||||||||||||||||
2610 | QQMLJS_DECLARE_AST_NODE(UiArrayMemberList) | - | ||||||||||||||||||
2611 | - | |||||||||||||||||||
2612 | UiArrayMemberList(UiObjectMember *member) | - | ||||||||||||||||||
2613 | : next(this), member(member) | - | ||||||||||||||||||
2614 | { kind = K; } executed 651 times by 25 tests: end of block Executed by:
| 651 | ||||||||||||||||||
2615 | - | |||||||||||||||||||
2616 | UiArrayMemberList(UiArrayMemberList *previous, UiObjectMember *member) | - | ||||||||||||||||||
2617 | : member(member) | - | ||||||||||||||||||
2618 | { | - | ||||||||||||||||||
2619 | kind = K; | - | ||||||||||||||||||
2620 | next = previous->next; | - | ||||||||||||||||||
2621 | previous->next = this; | - | ||||||||||||||||||
2622 | } executed 983 times by 21 tests: end of block Executed by:
| 983 | ||||||||||||||||||
2623 | - | |||||||||||||||||||
2624 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2625 | - | |||||||||||||||||||
2626 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2627 | { return member->firstSourceLocation(); } executed 2122 times by 1 test: return member->firstSourceLocation(); Executed by:
| 2122 | ||||||||||||||||||
2628 | - | |||||||||||||||||||
2629 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2630 | { return next ? next->lastSourceLocation() : member->lastSourceLocation(); } executed 9130 times by 1 test: return next ? next->lastSourceLocation() : member->lastSourceLocation(); Executed by:
| 9130 | ||||||||||||||||||
2631 | - | |||||||||||||||||||
2632 | UiArrayMemberList *finish() | - | ||||||||||||||||||
2633 | { | - | ||||||||||||||||||
2634 | UiArrayMemberList *head = next; | - | ||||||||||||||||||
2635 | next = nullptr; | - | ||||||||||||||||||
2636 | return head; executed 651 times by 25 tests: return head; Executed by:
| 651 | ||||||||||||||||||
2637 | } | - | ||||||||||||||||||
2638 | - | |||||||||||||||||||
2639 | // attributes | - | ||||||||||||||||||
2640 | UiArrayMemberList *next; | - | ||||||||||||||||||
2641 | UiObjectMember *member; | - | ||||||||||||||||||
2642 | SourceLocation commaToken; | - | ||||||||||||||||||
2643 | }; | - | ||||||||||||||||||
2644 | - | |||||||||||||||||||
2645 | class QML_PARSER_EXPORT UiObjectInitializer: public Node | - | ||||||||||||||||||
2646 | { | - | ||||||||||||||||||
2647 | public: | - | ||||||||||||||||||
2648 | QQMLJS_DECLARE_AST_NODE(UiObjectInitializer) | - | ||||||||||||||||||
2649 | - | |||||||||||||||||||
2650 | UiObjectInitializer(UiObjectMemberList *members) | - | ||||||||||||||||||
2651 | : members(members) | - | ||||||||||||||||||
2652 | { kind = K; } executed 115103 times by 143 tests: end of block Executed by:
| 115103 | ||||||||||||||||||
2653 | - | |||||||||||||||||||
2654 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2655 | - | |||||||||||||||||||
2656 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2657 | { return lbraceToken; } executed 136992 times by 1 test: return lbraceToken; Executed by:
| 136992 | ||||||||||||||||||
2658 | - | |||||||||||||||||||
2659 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2660 | { return rbraceToken; } executed 136992 times by 1 test: return rbraceToken; Executed by:
| 136992 | ||||||||||||||||||
2661 | - | |||||||||||||||||||
2662 | // attributes | - | ||||||||||||||||||
2663 | SourceLocation lbraceToken; | - | ||||||||||||||||||
2664 | UiObjectMemberList *members; | - | ||||||||||||||||||
2665 | SourceLocation rbraceToken; | - | ||||||||||||||||||
2666 | }; | - | ||||||||||||||||||
2667 | - | |||||||||||||||||||
2668 | class QML_PARSER_EXPORT UiParameterList: public Node | - | ||||||||||||||||||
2669 | { | - | ||||||||||||||||||
2670 | public: | - | ||||||||||||||||||
2671 | QQMLJS_DECLARE_AST_NODE(UiParameterList) | - | ||||||||||||||||||
2672 | - | |||||||||||||||||||
2673 | UiParameterList(UiQualifiedId *t, const QStringRef &n): | - | ||||||||||||||||||
2674 | type (t), name (n), next (this) | - | ||||||||||||||||||
2675 | { kind = K; } executed 86 times by 7 tests: end of block Executed by:
| 86 | ||||||||||||||||||
2676 | - | |||||||||||||||||||
2677 | UiParameterList(UiParameterList *previous, UiQualifiedId *t, const QStringRef &n): | - | ||||||||||||||||||
2678 | type (t), name (n) | - | ||||||||||||||||||
2679 | { | - | ||||||||||||||||||
2680 | kind = K; | - | ||||||||||||||||||
2681 | next = previous->next; | - | ||||||||||||||||||
2682 | previous->next = this; | - | ||||||||||||||||||
2683 | } executed 58 times by 6 tests: end of block Executed by:
| 58 | ||||||||||||||||||
2684 | - | |||||||||||||||||||
2685 | void accept0(Visitor *) override; | - | ||||||||||||||||||
2686 | - | |||||||||||||||||||
2687 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2688 | { return propertyTypeToken; } never executed: return propertyTypeToken; | 0 | ||||||||||||||||||
2689 | - | |||||||||||||||||||
2690 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2691 | { return next ? next->lastSourceLocation() : identifierToken; } never executed: return next ? next->lastSourceLocation() : identifierToken; | 0 | ||||||||||||||||||
2692 | - | |||||||||||||||||||
2693 | inline UiParameterList *finish () | - | ||||||||||||||||||
2694 | { | - | ||||||||||||||||||
2695 | UiParameterList *front = next; | - | ||||||||||||||||||
2696 | next = nullptr; | - | ||||||||||||||||||
2697 | return front; executed 86 times by 7 tests: return front; Executed by:
| 86 | ||||||||||||||||||
2698 | } | - | ||||||||||||||||||
2699 | - | |||||||||||||||||||
2700 | // attributes | - | ||||||||||||||||||
2701 | UiQualifiedId *type; | - | ||||||||||||||||||
2702 | QStringRef name; | - | ||||||||||||||||||
2703 | UiParameterList *next; | - | ||||||||||||||||||
2704 | SourceLocation commaToken; | - | ||||||||||||||||||
2705 | SourceLocation propertyTypeToken; | - | ||||||||||||||||||
2706 | SourceLocation identifierToken; | - | ||||||||||||||||||
2707 | }; | - | ||||||||||||||||||
2708 | - | |||||||||||||||||||
2709 | class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember | - | ||||||||||||||||||
2710 | { | - | ||||||||||||||||||
2711 | public: | - | ||||||||||||||||||
2712 | QQMLJS_DECLARE_AST_NODE(UiPublicMember) | - | ||||||||||||||||||
2713 | - | |||||||||||||||||||
2714 | UiPublicMember(UiQualifiedId *memberType, | - | ||||||||||||||||||
2715 | const QStringRef &name) | - | ||||||||||||||||||
2716 | : type(Property), memberType(memberType), name(name), statement(nullptr), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr) | - | ||||||||||||||||||
2717 | { kind = K; } executed 5280 times by 72 tests: end of block Executed by:
| 5280 | ||||||||||||||||||
2718 | - | |||||||||||||||||||
2719 | UiPublicMember(UiQualifiedId *memberType, | - | ||||||||||||||||||
2720 | const QStringRef &name, | - | ||||||||||||||||||
2721 | Statement *statement) | - | ||||||||||||||||||
2722 | : type(Property), memberType(memberType), name(name), statement(statement), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr) | - | ||||||||||||||||||
2723 | { kind = K; } executed 14231 times by 99 tests: end of block Executed by:
| 14231 | ||||||||||||||||||
2724 | - | |||||||||||||||||||
2725 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2726 | - | |||||||||||||||||||
2727 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2728 | { | - | ||||||||||||||||||
2729 | if (defaultToken.isValid())
| 165-57801 | ||||||||||||||||||
2730 | return defaultToken; executed 165 times by 5 tests: return defaultToken; Executed by:
| 165 | ||||||||||||||||||
2731 | else if (readonlyToken.isValid())
| 199-57602 | ||||||||||||||||||
2732 | return readonlyToken; executed 199 times by 9 tests: return readonlyToken; Executed by:
| 199 | ||||||||||||||||||
2733 | - | |||||||||||||||||||
2734 | return propertyToken; executed 57602 times by 102 tests: return propertyToken; Executed by:
| 57602 | ||||||||||||||||||
2735 | } | - | ||||||||||||||||||
2736 | - | |||||||||||||||||||
2737 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2738 | { | - | ||||||||||||||||||
2739 | if (binding)
| 2418-41523 | ||||||||||||||||||
2740 | return binding->lastSourceLocation(); executed 2418 times by 1 test: return binding->lastSourceLocation(); Executed by:
| 2418 | ||||||||||||||||||
2741 | if (statement)
| 4556-36967 | ||||||||||||||||||
2742 | return statement->lastSourceLocation(); executed 36967 times by 69 tests: return statement->lastSourceLocation(); Executed by:
| 36967 | ||||||||||||||||||
2743 | - | |||||||||||||||||||
2744 | return semicolonToken; executed 4556 times by 1 test: return semicolonToken; Executed by:
| 4556 | ||||||||||||||||||
2745 | } | - | ||||||||||||||||||
2746 | - | |||||||||||||||||||
2747 | // attributes | - | ||||||||||||||||||
2748 | enum { Signal, Property } type; | - | ||||||||||||||||||
2749 | QStringRef typeModifier; | - | ||||||||||||||||||
2750 | UiQualifiedId *memberType; | - | ||||||||||||||||||
2751 | QStringRef name; | - | ||||||||||||||||||
2752 | Statement *statement; // initialized with a JS expression | - | ||||||||||||||||||
2753 | UiObjectMember *binding; // initialized with a QML object or array. | - | ||||||||||||||||||
2754 | bool isDefaultMember; | - | ||||||||||||||||||
2755 | bool isReadonlyMember; | - | ||||||||||||||||||
2756 | UiParameterList *parameters; | - | ||||||||||||||||||
2757 | SourceLocation defaultToken; | - | ||||||||||||||||||
2758 | SourceLocation readonlyToken; | - | ||||||||||||||||||
2759 | SourceLocation propertyToken; | - | ||||||||||||||||||
2760 | SourceLocation typeModifierToken; | - | ||||||||||||||||||
2761 | SourceLocation typeToken; | - | ||||||||||||||||||
2762 | SourceLocation identifierToken; | - | ||||||||||||||||||
2763 | SourceLocation colonToken; | - | ||||||||||||||||||
2764 | SourceLocation semicolonToken; | - | ||||||||||||||||||
2765 | }; | - | ||||||||||||||||||
2766 | - | |||||||||||||||||||
2767 | class QML_PARSER_EXPORT UiObjectDefinition: public UiObjectMember | - | ||||||||||||||||||
2768 | { | - | ||||||||||||||||||
2769 | public: | - | ||||||||||||||||||
2770 | QQMLJS_DECLARE_AST_NODE(UiObjectDefinition) | - | ||||||||||||||||||
2771 | - | |||||||||||||||||||
2772 | UiObjectDefinition(UiQualifiedId *qualifiedTypeNameId, | - | ||||||||||||||||||
2773 | UiObjectInitializer *initializer) | - | ||||||||||||||||||
2774 | : qualifiedTypeNameId(qualifiedTypeNameId), initializer(initializer) | - | ||||||||||||||||||
2775 | { kind = K; } executed 109079 times by 143 tests: end of block Executed by:
| 109079 | ||||||||||||||||||
2776 | - | |||||||||||||||||||
2777 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2778 | - | |||||||||||||||||||
2779 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2780 | { return qualifiedTypeNameId->identifierToken; } executed 210460 times by 1 test: return qualifiedTypeNameId->identifierToken; Executed by:
| 210460 | ||||||||||||||||||
2781 | - | |||||||||||||||||||
2782 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2783 | { return initializer->rbraceToken; } executed 296546 times by 1 test: return initializer->rbraceToken; Executed by:
| 296546 | ||||||||||||||||||
2784 | - | |||||||||||||||||||
2785 | // attributes | - | ||||||||||||||||||
2786 | UiQualifiedId *qualifiedTypeNameId; | - | ||||||||||||||||||
2787 | UiObjectInitializer *initializer; | - | ||||||||||||||||||
2788 | }; | - | ||||||||||||||||||
2789 | - | |||||||||||||||||||
2790 | class QML_PARSER_EXPORT UiSourceElement: public UiObjectMember | - | ||||||||||||||||||
2791 | { | - | ||||||||||||||||||
2792 | public: | - | ||||||||||||||||||
2793 | QQMLJS_DECLARE_AST_NODE(UiSourceElement) | - | ||||||||||||||||||
2794 | - | |||||||||||||||||||
2795 | UiSourceElement(Node *sourceElement) | - | ||||||||||||||||||
2796 | : sourceElement(sourceElement) | - | ||||||||||||||||||
2797 | { kind = K; } executed 5913 times by 56 tests: end of block Executed by:
| 5913 | ||||||||||||||||||
2798 | - | |||||||||||||||||||
2799 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2800 | { | - | ||||||||||||||||||
2801 | if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
| 0-8698 | ||||||||||||||||||
2802 | return funDecl->firstSourceLocation(); executed 8698 times by 1 test: return funDecl->firstSourceLocation(); Executed by:
| 8698 | ||||||||||||||||||
2803 | else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
| 0 | ||||||||||||||||||
2804 | return varStmt->firstSourceLocation(); never executed: return varStmt->firstSourceLocation(); | 0 | ||||||||||||||||||
2805 | - | |||||||||||||||||||
2806 | return SourceLocation(); never executed: return SourceLocation(); | 0 | ||||||||||||||||||
2807 | } | - | ||||||||||||||||||
2808 | - | |||||||||||||||||||
2809 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2810 | { | - | ||||||||||||||||||
2811 | if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement))
| 0-14070 | ||||||||||||||||||
2812 | return funDecl->lastSourceLocation(); executed 14070 times by 1 test: return funDecl->lastSourceLocation(); Executed by:
| 14070 | ||||||||||||||||||
2813 | else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement))
| 0 | ||||||||||||||||||
2814 | return varStmt->lastSourceLocation(); never executed: return varStmt->lastSourceLocation(); | 0 | ||||||||||||||||||
2815 | - | |||||||||||||||||||
2816 | return SourceLocation(); never executed: return SourceLocation(); | 0 | ||||||||||||||||||
2817 | } | - | ||||||||||||||||||
2818 | - | |||||||||||||||||||
2819 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2820 | - | |||||||||||||||||||
2821 | - | |||||||||||||||||||
2822 | // attributes | - | ||||||||||||||||||
2823 | Node *sourceElement; | - | ||||||||||||||||||
2824 | }; | - | ||||||||||||||||||
2825 | - | |||||||||||||||||||
2826 | class QML_PARSER_EXPORT UiObjectBinding: public UiObjectMember | - | ||||||||||||||||||
2827 | { | - | ||||||||||||||||||
2828 | public: | - | ||||||||||||||||||
2829 | QQMLJS_DECLARE_AST_NODE(UiObjectBinding) | - | ||||||||||||||||||
2830 | - | |||||||||||||||||||
2831 | UiObjectBinding(UiQualifiedId *qualifiedId, | - | ||||||||||||||||||
2832 | UiQualifiedId *qualifiedTypeNameId, | - | ||||||||||||||||||
2833 | UiObjectInitializer *initializer) | - | ||||||||||||||||||
2834 | : qualifiedId(qualifiedId), | - | ||||||||||||||||||
2835 | qualifiedTypeNameId(qualifiedTypeNameId), | - | ||||||||||||||||||
2836 | initializer(initializer), | - | ||||||||||||||||||
2837 | hasOnToken(false) | - | ||||||||||||||||||
2838 | { kind = K; } executed 6024 times by 78 tests: end of block Executed by:
| 6024 | ||||||||||||||||||
2839 | - | |||||||||||||||||||
2840 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2841 | { | - | ||||||||||||||||||
2842 | if (hasOnToken && qualifiedTypeNameId)
| 0-17220 | ||||||||||||||||||
2843 | return qualifiedTypeNameId->identifierToken; executed 4444 times by 1 test: return qualifiedTypeNameId->identifierToken; Executed by:
| 4444 | ||||||||||||||||||
2844 | - | |||||||||||||||||||
2845 | return qualifiedId->identifierToken; executed 17220 times by 1 test: return qualifiedId->identifierToken; Executed by:
| 17220 | ||||||||||||||||||
2846 | } | - | ||||||||||||||||||
2847 | - | |||||||||||||||||||
2848 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2849 | { return initializer->rbraceToken; } executed 37382 times by 1 test: return initializer->rbraceToken; Executed by:
| 37382 | ||||||||||||||||||
2850 | - | |||||||||||||||||||
2851 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2852 | - | |||||||||||||||||||
2853 | - | |||||||||||||||||||
2854 | // attributes | - | ||||||||||||||||||
2855 | UiQualifiedId *qualifiedId; | - | ||||||||||||||||||
2856 | UiQualifiedId *qualifiedTypeNameId; | - | ||||||||||||||||||
2857 | UiObjectInitializer *initializer; | - | ||||||||||||||||||
2858 | SourceLocation colonToken; | - | ||||||||||||||||||
2859 | bool hasOnToken; | - | ||||||||||||||||||
2860 | }; | - | ||||||||||||||||||
2861 | - | |||||||||||||||||||
2862 | class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember | - | ||||||||||||||||||
2863 | { | - | ||||||||||||||||||
2864 | public: | - | ||||||||||||||||||
2865 | QQMLJS_DECLARE_AST_NODE(UiScriptBinding) | - | ||||||||||||||||||
2866 | - | |||||||||||||||||||
2867 | UiScriptBinding(UiQualifiedId *qualifiedId, | - | ||||||||||||||||||
2868 | Statement *statement) | - | ||||||||||||||||||
2869 | : qualifiedId(qualifiedId), | - | ||||||||||||||||||
2870 | statement(statement) | - | ||||||||||||||||||
2871 | { kind = K; } executed 226454 times by 138 tests: end of block Executed by:
| 226454 | ||||||||||||||||||
2872 | - | |||||||||||||||||||
2873 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2874 | { return qualifiedId->identifierToken; } executed 856692 times by 113 tests: return qualifiedId->identifierToken; Executed by:
| 856692 | ||||||||||||||||||
2875 | - | |||||||||||||||||||
2876 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2877 | { return statement->lastSourceLocation(); } executed 716708 times by 113 tests: return statement->lastSourceLocation(); Executed by:
| 716708 | ||||||||||||||||||
2878 | - | |||||||||||||||||||
2879 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2880 | - | |||||||||||||||||||
2881 | // attributes | - | ||||||||||||||||||
2882 | UiQualifiedId *qualifiedId; | - | ||||||||||||||||||
2883 | Statement *statement; | - | ||||||||||||||||||
2884 | SourceLocation colonToken; | - | ||||||||||||||||||
2885 | }; | - | ||||||||||||||||||
2886 | - | |||||||||||||||||||
2887 | class QML_PARSER_EXPORT UiArrayBinding: public UiObjectMember | - | ||||||||||||||||||
2888 | { | - | ||||||||||||||||||
2889 | public: | - | ||||||||||||||||||
2890 | QQMLJS_DECLARE_AST_NODE(UiArrayBinding) | - | ||||||||||||||||||
2891 | - | |||||||||||||||||||
2892 | UiArrayBinding(UiQualifiedId *qualifiedId, | - | ||||||||||||||||||
2893 | UiArrayMemberList *members) | - | ||||||||||||||||||
2894 | : qualifiedId(qualifiedId), | - | ||||||||||||||||||
2895 | members(members) | - | ||||||||||||||||||
2896 | { kind = K; } executed 651 times by 25 tests: end of block Executed by:
| 651 | ||||||||||||||||||
2897 | - | |||||||||||||||||||
2898 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2899 | { return qualifiedId->identifierToken; } executed 1860 times by 1 test: return qualifiedId->identifierToken; Executed by:
| 1860 | ||||||||||||||||||
2900 | - | |||||||||||||||||||
2901 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2902 | { return rbracketToken; } executed 4028 times by 1 test: return rbracketToken; Executed by:
| 4028 | ||||||||||||||||||
2903 | - | |||||||||||||||||||
2904 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2905 | - | |||||||||||||||||||
2906 | // attributes | - | ||||||||||||||||||
2907 | UiQualifiedId *qualifiedId; | - | ||||||||||||||||||
2908 | UiArrayMemberList *members; | - | ||||||||||||||||||
2909 | SourceLocation colonToken; | - | ||||||||||||||||||
2910 | SourceLocation lbracketToken; | - | ||||||||||||||||||
2911 | SourceLocation rbracketToken; | - | ||||||||||||||||||
2912 | }; | - | ||||||||||||||||||
2913 | - | |||||||||||||||||||
2914 | class QML_PARSER_EXPORT UiEnumMemberList: public Node | - | ||||||||||||||||||
2915 | { | - | ||||||||||||||||||
2916 | QQMLJS_DECLARE_AST_NODE(UiEnumMemberList) | - | ||||||||||||||||||
2917 | public: | - | ||||||||||||||||||
2918 | UiEnumMemberList(const QStringRef &member, double v = 0.0) | - | ||||||||||||||||||
2919 | : next(this), member(member), value(v) | - | ||||||||||||||||||
2920 | { kind = K; } executed 22 times by 1 test: end of block Executed by:
| 22 | ||||||||||||||||||
2921 | - | |||||||||||||||||||
2922 | UiEnumMemberList(UiEnumMemberList *previous, const QStringRef &member) | - | ||||||||||||||||||
2923 | : member(member) | - | ||||||||||||||||||
2924 | { | - | ||||||||||||||||||
2925 | kind = K; | - | ||||||||||||||||||
2926 | next = previous->next; | - | ||||||||||||||||||
2927 | previous->next = this; | - | ||||||||||||||||||
2928 | value = previous->value + 1; | - | ||||||||||||||||||
2929 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||||||||
2930 | - | |||||||||||||||||||
2931 | UiEnumMemberList(UiEnumMemberList *previous, const QStringRef &member, double v) | - | ||||||||||||||||||
2932 | : member(member), value(v) | - | ||||||||||||||||||
2933 | { | - | ||||||||||||||||||
2934 | kind = K; | - | ||||||||||||||||||
2935 | next = previous->next; | - | ||||||||||||||||||
2936 | previous->next = this; | - | ||||||||||||||||||
2937 | } executed 14 times by 1 test: end of block Executed by:
| 14 | ||||||||||||||||||
2938 | - | |||||||||||||||||||
2939 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2940 | { return memberToken; } executed 36 times by 1 test: return memberToken; Executed by:
| 36 | ||||||||||||||||||
2941 | - | |||||||||||||||||||
2942 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2943 | { return next ? next->lastSourceLocation() : executed 104 times by 1 test: return next ? next->lastSourceLocation() : valueToken.isValid() ? valueToken : memberToken; Executed by:
| 104 | ||||||||||||||||||
2944 | valueToken.isValid() ? valueToken : memberToken; } executed 104 times by 1 test: return next ? next->lastSourceLocation() : valueToken.isValid() ? valueToken : memberToken; Executed by:
| 104 | ||||||||||||||||||
2945 | - | |||||||||||||||||||
2946 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2947 | - | |||||||||||||||||||
2948 | UiEnumMemberList *finish() | - | ||||||||||||||||||
2949 | { | - | ||||||||||||||||||
2950 | UiEnumMemberList *head = next; | - | ||||||||||||||||||
2951 | next = nullptr; | - | ||||||||||||||||||
2952 | return head; executed 18 times by 1 test: return head; Executed by:
| 18 | ||||||||||||||||||
2953 | } | - | ||||||||||||||||||
2954 | - | |||||||||||||||||||
2955 | // attributes | - | ||||||||||||||||||
2956 | UiEnumMemberList *next; | - | ||||||||||||||||||
2957 | QStringRef member; | - | ||||||||||||||||||
2958 | double value; | - | ||||||||||||||||||
2959 | SourceLocation memberToken; | - | ||||||||||||||||||
2960 | SourceLocation valueToken; | - | ||||||||||||||||||
2961 | }; | - | ||||||||||||||||||
2962 | - | |||||||||||||||||||
2963 | class QML_PARSER_EXPORT UiEnumDeclaration: public UiObjectMember | - | ||||||||||||||||||
2964 | { | - | ||||||||||||||||||
2965 | public: | - | ||||||||||||||||||
2966 | QQMLJS_DECLARE_AST_NODE(UiEnumDeclaration) | - | ||||||||||||||||||
2967 | - | |||||||||||||||||||
2968 | UiEnumDeclaration(const QStringRef &name, | - | ||||||||||||||||||
2969 | UiEnumMemberList *members) | - | ||||||||||||||||||
2970 | : name(name) | - | ||||||||||||||||||
2971 | , members(members) | - | ||||||||||||||||||
2972 | { kind = K; } executed 18 times by 1 test: end of block Executed by:
| 18 | ||||||||||||||||||
2973 | - | |||||||||||||||||||
2974 | SourceLocation firstSourceLocation() const override | - | ||||||||||||||||||
2975 | { return enumToken; } executed 128 times by 1 test: return enumToken; Executed by:
| 128 | ||||||||||||||||||
2976 | - | |||||||||||||||||||
2977 | SourceLocation lastSourceLocation() const override | - | ||||||||||||||||||
2978 | { return rbraceToken; } executed 84 times by 1 test: return rbraceToken; Executed by:
| 84 | ||||||||||||||||||
2979 | - | |||||||||||||||||||
2980 | void accept0(Visitor *visitor) override; | - | ||||||||||||||||||
2981 | - | |||||||||||||||||||
2982 | // attributes | - | ||||||||||||||||||
2983 | SourceLocation enumToken; | - | ||||||||||||||||||
2984 | SourceLocation rbraceToken; | - | ||||||||||||||||||
2985 | QStringRef name; | - | ||||||||||||||||||
2986 | UiEnumMemberList *members; | - | ||||||||||||||||||
2987 | }; | - | ||||||||||||||||||
2988 | - | |||||||||||||||||||
2989 | } } // namespace AST | - | ||||||||||||||||||
2990 | - | |||||||||||||||||||
2991 | - | |||||||||||||||||||
2992 | - | |||||||||||||||||||
2993 | QT_QML_END_NAMESPACE | - | ||||||||||||||||||
2994 | - | |||||||||||||||||||
2995 | #endif | - | ||||||||||||||||||
Source code | Switch to Preprocessed file |