[Feat] 面对对象(struct)支持,完成对其初始化解析。 [Impl] Value更换为Object,且简单类型按值存储,复杂类型为shared_ptr。 [Impl] 全局使用 Object shared_ptr
26 lines
455 B
C++
26 lines
455 B
C++
#pragma once
|
|
|
|
#include <Ast/astBase.hpp>
|
|
|
|
#include <value.hpp>
|
|
|
|
namespace Fig::Ast
|
|
{
|
|
class ValueExprAst final : public ExpressionAst
|
|
{
|
|
public:
|
|
ObjectPtr val;
|
|
|
|
ValueExprAst()
|
|
{
|
|
type = AstType::ValueExpr;
|
|
}
|
|
ValueExprAst(ObjectPtr _val)
|
|
{
|
|
type = AstType::ValueExpr;
|
|
val = std::move(_val);
|
|
}
|
|
};
|
|
|
|
using ValueExpr = std::shared_ptr<ValueExprAst>;
|
|
}; |