* actually run the parse session */
| 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; |
nothing calls this directly
no test coverage detected