feat: 增加了analyzer, compiler不再分析并且报错, 只生产 bytecode, analyzer作为前端结束最后一道防线检查代码,同时引入一个简单的LSP

This commit is contained in:
2026-02-23 19:57:28 +08:00
parent 852dd27836
commit b7bb889676
28 changed files with 26665 additions and 3153 deletions

View File

@@ -100,6 +100,11 @@ namespace Fig
return source;
}
String &GetSource()
{
return source;
}
std::pair<size_t, size_t> GetLineColumn(size_t index) const
{
if (lineStartIndex.empty())
@@ -130,5 +135,12 @@ namespace Fig
size_t column = index - lineStartIndex[line] + 1;
return {line + 1, column};
}
void LoadFromMemory(String src)
{
source = std::move(src);
read = true;
preprocessLineIndices();
}
};
}; // namespace Fig