MCPcopy Create free account
hub / github.com/KDE/kdevelop / runSession

Method runSession

plugins/qmljs/tests/qml-parser.cpp:45–76  ·  view source on GitHub ↗

* actually run the parse session */

Source from the content-addressed store, hash-verified

43 * actually run the parse session
44 */
45 void runSession()
46 {
47 if (!m_session->isParsedCorrectly()) {
48 qerr << "failed to parse code" << Qt::endl;
49 }
50 if (m_printTokens) {
51 qerr << "token cannot be printed for qml/js source..." << Qt::endl;
52 }
53
54 if (!m_session->ast()) {
55 qerr << "no AST tree could be generated" << Qt::endl;
56 } else {
57 qout << "AST tree successfully generated" << Qt::endl;
58 if (m_printAst) {
59 ///FIXME:
60 DebugVisitor visitor(m_session.data());
61 visitor.startVisiting(m_session->ast());
62 }
63 }
64 if (!m_session->problems().isEmpty()) {
65 qerr << "\nproblems encountered during parsing:" << Qt::endl;
66 foreach(const ProblemPointer problem, m_session->problems()) {
67 qerr << problem->toString();
68 }
69 } else {
70 qout << "no problems encountered during parsing" << Qt::endl;
71 }
72
73 if (!m_session->ast()) {
74 exit(255);
75 }
76 }
77
78 QScopedPointer<ParseSession> m_session;
79 const bool m_printAst;

Callers

nothing calls this directly

Calls 6

isParsedCorrectlyMethod · 0.80
astMethod · 0.45
dataMethod · 0.45
startVisitingMethod · 0.45
isEmptyMethod · 0.45
problemsMethod · 0.45

Tested by

no test coverage detected