OpenCoverage

qqmljsengine_p.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/parser/qqmljsengine_p.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6namespace QQmlJS {-
7-
8static inline int toDigit(char c)-
9{-
10 if ((
(c >= '0')Description
TRUEnever evaluated
FALSEnever evaluated
c >= '0')
(c >= '0')Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(c <= '9')Description
TRUEnever evaluated
FALSEnever evaluated
c <= '9')
(c <= '9')Description
TRUEnever evaluated
FALSEnever evaluated
)
0
11 return
never executed: return c - '0';
c - '0';
never executed: return c - '0';
0
12 else if ((
(c >= 'a')Description
TRUEnever evaluated
FALSEnever evaluated
c >= 'a')
(c >= 'a')Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(c <= 'z')Description
TRUEnever evaluated
FALSEnever evaluated
c <= 'z')
(c <= 'z')Description
TRUEnever evaluated
FALSEnever evaluated
)
0
13 return
never executed: return 10 + c - 'a';
10 + c - 'a';
never executed: return 10 + c - 'a';
0
14 else if ((
(c >= 'A')Description
TRUEnever evaluated
FALSEnever evaluated
c >= 'A')
(c >= 'A')Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(c <= 'Z')Description
TRUEnever evaluated
FALSEnever evaluated
c <= 'Z')
(c <= 'Z')Description
TRUEnever evaluated
FALSEnever evaluated
)
0
15 return
never executed: return 10 + c - 'A';
10 + c - 'A';
never executed: return 10 + c - 'A';
0
16 return
never executed: return -1;
-1;
never executed: return -1;
0
17}-
18-
19double integerFromString(const char *buf, int size, int radix)-
20{-
21 if (size == 0
size == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
22 return
never executed: return qt_qnan();
qt_qnan();
never executed: return qt_qnan();
0
23-
24 double sign = 1.0;-
25 int i = 0;-
26 if (buf[0] == '+'
buf[0] == '+'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
27 ++i;-
28 }
never executed: end of block
else if (buf[0] == '-'
buf[0] == '-'Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
29 sign = -1.0;-
30 ++i;-
31 }
never executed: end of block
0
32-
33 if (((
((size-i) >= 2)Description
TRUEnever evaluated
FALSEnever evaluated
size-i) >= 2)
((size-i) >= 2)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(buf[i] == '0')Description
TRUEnever evaluated
FALSEnever evaluated
buf[i] == '0')
(buf[i] == '0')Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
34 if (((
(buf[i+1] == 'x')Description
TRUEnever evaluated
FALSEnever evaluated
buf[i+1] == 'x')
(buf[i+1] == 'x')Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(buf[i+1] == 'X')Description
TRUEnever evaluated
FALSEnever evaluated
buf[i+1] == 'X')
(buf[i+1] == 'X')Description
TRUEnever evaluated
FALSEnever evaluated
)
0
35 && (
(radix < 34)Description
TRUEnever evaluated
FALSEnever evaluated
radix < 34)
(radix < 34)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
36 if ((
(radix != 0)Description
TRUEnever evaluated
FALSEnever evaluated
radix != 0)
(radix != 0)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(radix != 16)Description
TRUEnever evaluated
FALSEnever evaluated
radix != 16)
(radix != 16)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
37 return
never executed: return 0;
0;
never executed: return 0;
0
38 radix = 16;-
39 i += 2;-
40 }
never executed: end of block
else {
0
41 if (radix == 0
radix == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
42 radix = 8;-
43 ++i;-
44 }
never executed: end of block
0
45 }
never executed: end of block
0
46 } else if (radix == 0
radix == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
47 radix = 10;-
48 }
never executed: end of block
0
49-
50 int j = i;-
51 for ( ; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
52 int d = toDigit(buf[i]);-
53 if ((
(d == -1)Description
TRUEnever evaluated
FALSEnever evaluated
d == -1)
(d == -1)Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(d >= radix)Description
TRUEnever evaluated
FALSEnever evaluated
d >= radix)
(d >= radix)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
54 break;
never executed: break;
0
55 }
never executed: end of block
0
56 double result;-
57 if (j == i
j == iDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
58 if (!qstrcmp(buf, "Infinity")
!qstrcmp(buf, "Infinity")Description
TRUEnever evaluated
FALSEnever evaluated
)
0
59 result = qInf();
never executed: result = qInf();
0
60 else-
61 result = qt_qnan();
never executed: result = qt_qnan();
0
62 } else {-
63 result = 0;-
64 double multiplier = 1;-
65 for (--i ; i >= j
i >= jDescription
TRUEnever evaluated
FALSEnever evaluated
; --i, multiplier *= radix)
0
66 result += toDigit(buf[i]) * multiplier;
never executed: result += toDigit(buf[i]) * multiplier;
0
67 }
never executed: end of block
0
68 result *= sign;-
69 return
never executed: return result;
result;
never executed: return result;
0
70}-
71-
72Engine::Engine()-
73 : _lexer(nullptr), _directives(nullptr)-
74{ }
executed 2978571 times by 148 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • ...
2978571
75-
76Engine::~Engine()-
77{ }-
78-
79void Engine::setCode(const QString &code)-
80{ _code = code; }
executed 2979904 times by 148 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • ...
2979904
81-
82void Engine::addComment(int pos, int len, int line, int col)-
83{ if (len > 0
len > 0Description
TRUEevaluated 2066624 times by 93 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlimport
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllocale
  • tst_qqmlmoduleplugin
  • tst_qqmlnotifier
  • tst_qqmlparser
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsettings
  • ...
FALSEevaluated 16410 times by 7 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_examples
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlmin
  • tst_qqmlecmascript
  • tst_qqmlparser
) _comments.append(QQmlJS::AST::SourceLocation(pos, len, line, col));
executed 2067346 times by 93 tests: _comments.append(QQmlJS::AST::SourceLocation(pos, len, line, col));
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlimport
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllocale
  • tst_qqmlmoduleplugin
  • tst_qqmlnotifier
  • tst_qqmlparser
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsettings
  • ...
}
executed 2086837 times by 93 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlimport
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllocale
  • tst_qqmlmoduleplugin
  • tst_qqmlnotifier
  • tst_qqmlparser
  • tst_qqmlproperty
  • tst_qqmlqt
  • tst_qqmlsettings
  • ...
16410-2086837
84-
85QList<QQmlJS::AST::SourceLocation> Engine::comments() const-
86{ return
never executed: return _comments;
_comments;
never executed: return _comments;
}
0
87-
88Lexer *Engine::lexer() const-
89{ return
executed 2938488 times by 147 tests: return _lexer;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
_lexer;
executed 2938488 times by 147 tests: return _lexer;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
}
2938488
90-
91void Engine::setLexer(Lexer *lexer)-
92{ _lexer = lexer; }
executed 2978109 times by 148 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • ...
2978109
93-
94Directives *Engine::directives() const-
95{ return
executed 1768203 times by 26 tests: return _directives;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlincubator
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlparser
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_qquickworkerscript
  • tst_quicktestmainwithsetup
  • tst_qv4assembler
  • tst_qv4debugger
  • ...
_directives;
executed 1768203 times by 26 tests: return _directives;
Executed by:
  • tst_ecmascripttests
  • tst_examples
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlincubator
  • tst_qqmllistmodelworkerscript
  • tst_qqmlmetatype
  • tst_qqmlparser
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_qquickworkerscript
  • tst_quicktestmainwithsetup
  • tst_qv4assembler
  • tst_qv4debugger
  • ...
}
1768203
96-
97void Engine::setDirectives(Directives *directives)-
98{ _directives = directives; }
executed 116 times by 12 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlincubator
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qquickanimationcontroller
  • tst_qquicklayouts
  • tst_quicktestmainwithsetup
  • tst_testfiltering
116
99-
100MemoryPool *Engine::pool()-
101{ return
executed 3143856 times by 147 tests: return &_pool;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
&_pool;
executed 3143856 times by 147 tests: return &_pool;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
}
3143856
102-
103QStringRef Engine::newStringRef(const QString &text)-
104{-
105 const int pos = _extraCode.length();-
106 _extraCode += text;-
107 return
executed 1180168 times by 89 tests: return _extraCode.midRef(pos, text.length());
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • ...
_extraCode.midRef(pos, text.length());
executed 1180168 times by 89 tests: return _extraCode.midRef(pos, text.length());
Executed by:
  • tst_bindingdependencyapi
  • tst_ecmascripttests
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qmlcachegen
  • tst_qmlmin
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • ...
1180168
108}-
109-
110QStringRef Engine::newStringRef(const QChar *chars, int size)-
111{ return
never executed: return newStringRef(QString(chars, size));
newStringRef(QString(chars, size));
never executed: return newStringRef(QString(chars, size));
}
0
112-
113}-
114-
115-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0