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
+17 -1
View File
@@ -1,12 +1,28 @@
#pragma once
#include <set>
#include <string>
#include <vector>
#include "devtools/syntax.hpp"
#include "interfaces/Serializable.hpp"
namespace devtools {
struct Syntax : Serializable {
std::string language;
std::set<std::string> extensions;
std::set<std::wstring> keywords;
std::wstring lineComment;
std::wstring multilineCommentStart;
std::wstring multilineCommentEnd;
std::wstring multilineStringStart;
std::wstring multilineStringEnd;
dv::value serialize() const override;
void deserialize(const dv::value& src) override;
};
std::vector<Token> tokenize(
std::string_view file, std::wstring_view source
const Syntax& syntax, std::string_view file, std::wstring_view source
);
}