40 lines
862 B
C++
40 lines
862 B
C++
/*!
|
|
@file src/Ast/Expr/IdentiExpr.hpp
|
|
@brief IdentiExpr定义
|
|
@author PuqiAR (im@puqiar.top)
|
|
@date 2026-02-14
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Ast/Base.hpp>
|
|
#include <Deps/Deps.hpp>
|
|
|
|
namespace Fig
|
|
{
|
|
struct IdentiExpr final : Expr
|
|
{
|
|
String name;
|
|
|
|
// Analyzer槽位,存储具体深度
|
|
int resolvedDepth = -1; // 代表未解析
|
|
bool isGlobal = false; // 是否全局/对外公开 (isPublic)
|
|
|
|
IdentiExpr()
|
|
{
|
|
type = AstType::IdentiExpr;
|
|
}
|
|
|
|
IdentiExpr(String _name, SourceLocation _loc)
|
|
{
|
|
type = AstType::IdentiExpr;
|
|
name = std::move(_name);
|
|
location = std::move(_loc);
|
|
}
|
|
|
|
virtual String toString() const override
|
|
{
|
|
return std::format("<IdentiExpr: {}>", name);
|
|
}
|
|
};
|
|
}; |