Changeset View
Changeset View
Standalone View
Standalone View
duchain/expressionparser.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 50 | ExpressionEvaluationResult ExpressionParser::evaluateType(const QByteArray& expression, DUContextPointer context, | |||
---|---|---|---|---|---|
51 | const CursorInRevision &offset) | 51 | const CursorInRevision &offset) | ||
52 | { | 52 | { | ||
53 | if (m_debug) | 53 | if (m_debug) | ||
54 | qCDebug(DUCHAIN) << "==== .Evaluating ..:" << endl << expression; | 54 | qCDebug(DUCHAIN) << "==== .Evaluating ..:" << endl << expression; | ||
55 | 55 | | |||
56 | ParseSession* session = new ParseSession(); | 56 | ParseSession* session = new ParseSession(); | ||
57 | session->setContents(expression); | 57 | session->setContents(expression); | ||
58 | Parser* parser = session->createParser(Parser::DefaultState); | 58 | Parser* parser = session->createParser(Parser::DefaultState); | ||
59 | ExprAst* ast = 0; | 59 | ExprAst* ast = nullptr; | ||
60 | if (!parser->parseExpr(&ast)) { | 60 | if (!parser->parseExpr(&ast)) { | ||
61 | qCDebug(DUCHAIN) << "Failed to parse \"" << expression << "\""; | 61 | qCDebug(DUCHAIN) << "Failed to parse \"" << expression << "\""; | ||
62 | delete session; | 62 | delete session; | ||
63 | delete parser; | 63 | delete parser; | ||
64 | return ExpressionEvaluationResult(); | 64 | return ExpressionEvaluationResult(); | ||
65 | } | 65 | } | ||
66 | ast->ducontext = dynamic_cast<DUContext*>(context.data()); | 66 | ast->ducontext = dynamic_cast<DUContext*>(context.data()); | ||
67 | 67 | | |||
Show All 32 Lines |