[Feat] 详细区分左值(LvObject)与右值(RvObject -> ObjectPtr)
[Impl] 重构evaluator.cpp + hpp 全部 [Feat] 增加对于IndexExpr的解析 [Fix][Impl] 现在点运算符不由BinaryExpr负责,增加MemberExpr,单独实现解析 [Impl] 项目目录全部翻修, src/目录下单独文件夹放置每一个模块
This commit is contained in:
42
src/Evaluator/evaluator_error.hpp
Normal file
42
src/Evaluator/evaluator_error.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <Error/error.hpp>
|
||||
#include <Ast/astBase.hpp>
|
||||
|
||||
namespace Fig
|
||||
{
|
||||
class EvaluatorError final : public AddressableError
|
||||
{
|
||||
public:
|
||||
FString typeName;
|
||||
using AddressableError::AddressableError;
|
||||
EvaluatorError(FString _typeName, FString msg, Ast::AstBase ast, std::source_location loc = std::source_location::current())
|
||||
{
|
||||
message = FStringView::fromBasicStringView(msg.toBasicString());
|
||||
line = ast->getAAI().line;
|
||||
column = ast->getAAI().column;
|
||||
|
||||
src_loc = std::move(loc);
|
||||
|
||||
typeName = std::move(_typeName);
|
||||
|
||||
}
|
||||
EvaluatorError(FString _typeName, std::string_view msg, Ast::AstBase ast, std::source_location loc = std::source_location::current())
|
||||
{
|
||||
message = FStringView::fromBasicStringView(msg);
|
||||
line = ast->getAAI().line;
|
||||
column = ast->getAAI().column;
|
||||
|
||||
src_loc = std::move(loc);
|
||||
|
||||
typeName = std::move(_typeName);
|
||||
}
|
||||
|
||||
virtual FString getErrorType() const override
|
||||
{
|
||||
return typeName;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user