[Feat] 模块系统支持,使用 import x.x.x导入
[Fix] Context内部辅助函数修改, getStructName .... [Feat] 增加字符串下标获取操作,和修改字符操作,实现使用了第四点的函数 [Impl] FString添加新方法 getRealChar, realReplace [Fun] 在utf8_iterator中辱骂了C++
This commit is contained in:
27
src/Ast/Statements/ImportSt.hpp
Normal file
27
src/Ast/Statements/ImportSt.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <Ast/astBase.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Fig::Ast
|
||||
{
|
||||
class ImportSt final : public StatementAst
|
||||
{
|
||||
public:
|
||||
std::vector<FString> path;
|
||||
|
||||
ImportSt()
|
||||
{
|
||||
type = AstType::ImportSt;
|
||||
}
|
||||
|
||||
ImportSt(std::vector<FString> _path) :
|
||||
path(std::move(_path))
|
||||
{
|
||||
type = AstType::ImportSt;
|
||||
}
|
||||
};
|
||||
|
||||
using Import = std::shared_ptr<ImportSt>;
|
||||
};
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <Ast/Statements/StructDefSt.hpp>
|
||||
#include <Ast/Statements/IfSt.hpp>
|
||||
#include <Ast/Statements/ImplementSt.hpp>
|
||||
#include <Ast/Statements/ImportSt.hpp>
|
||||
#include <Ast/Statements/FunctionDefSt.hpp>
|
||||
#include <Ast/Statements/ControlSt.hpp>
|
||||
#include <Ast/Statements/ExpressionStmt.hpp>
|
||||
|
||||
@@ -50,12 +50,15 @@ namespace Fig::Ast
|
||||
ElseSt,
|
||||
ElseIfSt,
|
||||
|
||||
VarAssignSt,
|
||||
// VarAssignSt,
|
||||
WhileSt,
|
||||
ForSt,
|
||||
ReturnSt,
|
||||
BreakSt,
|
||||
ContinueSt,
|
||||
|
||||
PackageSt,
|
||||
ImportSt,
|
||||
};
|
||||
|
||||
// static const std::unordered_map<AstType, FString> astTypeToString{
|
||||
|
||||
Reference in New Issue
Block a user