尝试UTF32String

This commit is contained in:
2026-02-05 22:20:21 +08:00
parent d897f41c57
commit 9c68b2e77d
69 changed files with 3078 additions and 2605 deletions

View File

@@ -8,19 +8,9 @@ namespace Fig::Ast
{
public:
BlockStatement body;
ElseSt()
{
type = AstType::ElseSt;
}
ElseSt(BlockStatement _body) :
body(_body)
{
type = AstType::ElseSt;
}
virtual FString toString() override
{
return FString(std::format("<Else Ast at {}:{}>", aai.line, aai.column));
}
ElseSt() { type = AstType::ElseSt; }
ElseSt(BlockStatement _body) : body(_body) { type = AstType::ElseSt; }
virtual String toString() override { return String(std::format("<Else Ast at {}:{}>", aai.line, aai.column)); }
};
using Else = std::shared_ptr<ElseSt>;
class ElseIfSt final : public StatementAst
@@ -28,19 +18,14 @@ namespace Fig::Ast
public:
Expression condition;
BlockStatement body;
ElseIfSt()
ElseIfSt() { type = AstType::ElseIfSt; }
ElseIfSt(Expression _condition, BlockStatement _body) : condition(_condition), body(_body)
{
type = AstType::ElseIfSt;
}
ElseIfSt(Expression _condition,
BlockStatement _body) :
condition(_condition), body(_body)
virtual String toString() override
{
type = AstType::ElseIfSt;
}
virtual FString toString() override
{
return FString(std::format("<ElseIf Ast at {}:{}>", aai.line, aai.column));
return String(std::format("<ElseIf Ast at {}:{}>", aai.line, aai.column));
}
};
using ElseIf = std::shared_ptr<ElseIfSt>;
@@ -51,18 +36,12 @@ namespace Fig::Ast
BlockStatement body;
std::vector<ElseIf> elifs;
Else els;
IfSt()
{
type = AstType::IfSt;
}
IfSt(Expression _condition,
BlockStatement _body,
std::vector<ElseIf> _elifs,
Else _els) :
IfSt() { type = AstType::IfSt; }
IfSt(Expression _condition, BlockStatement _body, std::vector<ElseIf> _elifs, Else _els) :
condition(_condition), body(_body), elifs(_elifs), els(_els)
{
type = AstType::IfSt;
}
};
using If = std::shared_ptr<IfSt>;
}; // namespace Fig
}; // namespace Fig::Ast