删除部分冗余
This commit is contained in:
parent
ed7b7c7291
commit
fc1e13b74d
|
@ -22,8 +22,7 @@ QString NovelParser::version() const
|
|||
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;
|
||||
auto lex_reader = NovalSyntax::getLexReader();
|
||||
|
||||
|
|
|
@ -247,17 +247,5 @@ QList<std::shared_ptr<const TokenNode>> ExprsChecker::parseFrom(const QList<std:
|
|||
if (!all_tokens.size())
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue