修复EOF飘逸(去除末尾\n)以及其他修复...

This commit is contained in:
2026-02-18 00:16:59 +08:00
parent 663fe39070
commit c81da16dfb
18 changed files with 404 additions and 65 deletions

View File

@@ -0,0 +1,34 @@
/*!
@file src/Ast/Expr/IndexExpr.hpp
@brief IndexExpr定义
@author PuqiAR (im@puqiar.top)
@date 2026-02-17
*/
#pragma once
#include <Ast/Base.hpp>
namespace Fig
{
struct IndexExpr final : public Expr
{
Expr *base;
Expr *index;
IndexExpr()
{
type = AstType::IndexExpr;
}
IndexExpr(Expr *_base, Expr *_index) : base(_base), index(_index)
{
location = base->location;
}
virtual String toString() const override
{
return std::format("<IndexExpr: '{}[{}]'>", base->toString(), index->toString());
}
};
}; // namespace Fig