This commit is contained in:
2025-12-19 20:38:40 +08:00
commit 73c828d99b
83 changed files with 13068 additions and 0 deletions

34
include/Ast/VarDef.hpp Normal file
View File

@@ -0,0 +1,34 @@
#pragma once
#include <Ast/astBase.hpp>
#include <Value/Type.hpp>
namespace Fig::Ast
{
class VarDefAst final : public StatementAst
{
public:
bool isPublic;
bool isConst;
FString name;
FString typeName;
Expression expr;
VarDefAst() :
typeName(ValueType::Any.name)
{
type = AstType::VarDefSt;
}
VarDefAst(bool _isPublic, bool _isConst, FString _name, FString _info, Expression _expr) :
typeName(std::move(_info))
{
type = AstType::VarDefSt;
isPublic = _isPublic;
isConst = _isConst;
name = std::move(_name);
expr = std::move(_expr);
}
};
using VarDef = std::shared_ptr<VarDefAst>;
} // namespace Fig