feat: custom languages syntax (WIP)

This commit is contained in:
MihailRis
2025-04-13 00:19:38 +03:00
parent 4360cd408b
commit 5253be6c56
18 changed files with 278 additions and 88 deletions
+29
View File
@@ -0,0 +1,29 @@
#include "Editor.hpp"
#include "engine/Engine.hpp"
#include "io/engine_paths.hpp"
#include "coders/syntax_parser.hpp"
#include "SyntaxProcessor.hpp"
using namespace devtools;
Editor::Editor(Engine& engine)
: engine(engine), syntaxProcessor(std::make_unique<SyntaxProcessor>()) {
}
Editor::~Editor() = default;
void Editor::loadTools() {
const auto& paths = engine.getResPaths();
auto files = paths.listdir("devtools/syntax");
for (const auto& file : files) {
auto config = io::read_object(file);
auto syntax = std::make_unique<Syntax>();
syntax->deserialize(config);
syntaxProcessor->addSyntax(std::move(syntax));
}
}
SyntaxProcessor& Editor::getSyntaxProcessor() {
return *syntaxProcessor;
}