删除部分冗余

This commit is contained in:
codeboss 2024-06-15 23:08:23 +08:00
parent ed7b7c7291
commit fc1e13b74d
2 changed files with 1 additions and 14 deletions

View File

@ -22,8 +22,7 @@ QString NovelParser::version() const
return "1.0.0"; return "1.0.0";
} }
std::shared_ptr<const ast_gen::ElementAccess> NovelParser::parse(const QFileInfoList source_list) const std::shared_ptr<const ast_gen::ElementAccess> NovelParser::parse(const QFileInfoList source_list) const {
{
QList<std::shared_ptr<const ast_basic::TokenNode>> forst_root; QList<std::shared_ptr<const ast_basic::TokenNode>> forst_root;
auto lex_reader = NovalSyntax::getLexReader(); auto lex_reader = NovalSyntax::getLexReader();

View File

@ -247,17 +247,5 @@ QList<std::shared_ptr<const TokenNode>> ExprsChecker::parseFrom(const QList<std:
if (!all_tokens.size()) if (!all_tokens.size())
return QList<std::shared_ptr<const TokenNode>>(); return QList<std::shared_ptr<const TokenNode>>();
int progress = 0;
while (progress < all_tokens.size()) {
auto result = this->syntax_tree_root->match(all_tokens.mid(progress));
progress += std::get<1>(result);
if (std::get<0>(result) != BaseRule::MatchResult::Success) {
auto target = all_tokens[progress + 1];
throw new SyntaxException(QString(u8"Syntax[0x0003]代码自'%1<%2,%3>'后无法匹配:%4。")
.arg(target->content()).arg(target->row()).arg(target->column()).arg(target->file()));
}
}
return this->syntax_tree_root->parse(all_tokens); return this->syntax_tree_root->parse(all_tokens);
} }