mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
feat: custom languages syntax (WIP)
This commit is contained in:
parent
4360cd408b
commit
5253be6c56
18 changed files with 278 additions and 88 deletions
29
src/devtools/Editor.cpp
Normal file
29
src/devtools/Editor.cpp
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue