mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21: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
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue