update
This commit is contained in:
parent
1744a705bd
commit
405ef03a28
|
@ -68,24 +68,45 @@ public:
|
||||||
QList<std::shared_ptr<const MatchCursor>> expr_rule_parse(std::shared_ptr<const MatchCursor> cursor) const override {
|
QList<std::shared_ptr<const MatchCursor>> expr_rule_parse(std::shared_ptr<const MatchCursor> cursor) const override {
|
||||||
//// 如果提前结束,记录错误并返回
|
//// 如果提前结束,记录错误并返回
|
||||||
//if (!cursor->words()) {
|
//if (!cursor->words()) {
|
||||||
|
// // 只有在表达式的起始点遇到nullptr,才是正常结束。
|
||||||
|
// if (cursor->token()->tokenType() != lib_token::IActionToken::Type::ElementBegin) {
|
||||||
|
// auto ncurs = std::make_shared<MatchCursor>(cursor);
|
||||||
|
// ncurs->logExprsError(QString("Syntax[0x00001]输入错误,程序提前结束:%1。").arg(cursor->filePath()));
|
||||||
|
// ncurs->setFailure();
|
||||||
|
// return QList<std::shared_ptr<const MatchCursor>>() << ncurs;
|
||||||
|
// }
|
||||||
|
|
||||||
// while (cursor->token()->tokenType() == lib_token::IActionToken::Type::ElementBegin)
|
// while (cursor->token()->tokenType() == lib_token::IActionToken::Type::ElementBegin)
|
||||||
// cursor = cursor->previous();
|
// cursor = cursor->previous();
|
||||||
|
|
||||||
// out << cursor;
|
// auto ncurs = std::make_shared<MatchCursor>(cursor);
|
||||||
// return QList<std::shared_ptr<const MatchCursor>>();
|
// ncurs->setComplete();
|
||||||
|
// return QList<std::shared_ptr<const MatchCursor>>() << ncurs;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
//auto content = content_extract(cursor->token());
|
||||||
|
|
||||||
//// 绑定文字行
|
//// 绑定文字行
|
||||||
//auto bind_row = cursor->words()->row();
|
//auto bind_row = cursor->words()->row();
|
||||||
//QList<std::shared_ptr<const MatchCursor>> bridge_list{ cursor };
|
//QList<std::shared_ptr<const MatchCursor>> bridge_list{ cursor };
|
||||||
//decltype(bridge_list) final_result;
|
//decltype(bridge_list) final_result;
|
||||||
|
|
||||||
//for (; bridge_list.size();) {
|
//for (; bridge_list.size();) {
|
||||||
// // 一次匹配
|
// // 一次匹配
|
||||||
// decltype(bridge_list) current_result;
|
// decltype(bridge_list) current_result;
|
||||||
// for (auto branch : bridge_list) {
|
// for (auto branch : bridge_list) {
|
||||||
// if (branch->words()->row() == bind_row) {
|
// if (branch->words()->row() == bind_row) {
|
||||||
// auto mrst = _children_store->parse(branch, out);
|
// auto mrst = _children_store->parse(branch);
|
||||||
|
|
||||||
|
// // 本次解析无法通过,全错
|
||||||
|
// if (!std::count_if(mrst.begin(), mrst.end(),
|
||||||
|
// [&](std::shared_ptr<const MatchCursor> v) {
|
||||||
|
// return !v->exprsErrorCount();// 没错
|
||||||
|
// })) {
|
||||||
|
// final_result.append(branch);
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //
|
||||||
// for (auto m : mrst) {
|
// for (auto m : mrst) {
|
||||||
// if (m->exprsErrorCount()) {
|
// if (m->exprsErrorCount()) {
|
||||||
// std::const_pointer_cast<MatchCursor>(m)->setFailure(true);
|
// std::const_pointer_cast<MatchCursor>(m)->setFailure(true);
|
||||||
|
@ -99,6 +120,7 @@ public:
|
||||||
// }
|
// }
|
||||||
// bridge_list = current_result;
|
// bridge_list = current_result;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//for (auto x : bridge_list)
|
//for (auto x : bridge_list)
|
||||||
// if (!final_result.contains(x))
|
// if (!final_result.contains(x))
|
||||||
// final_result.append(x);
|
// final_result.append(x);
|
||||||
|
|
Loading…
Reference in New Issue