add markdown dialect (WIP) & add strikethrough and underline font styles
This commit is contained in:
@@ -3,33 +3,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "devtools/syntax.hpp"
|
||||
|
||||
namespace lua {
|
||||
struct Location {
|
||||
int pos;
|
||||
int lineStart;
|
||||
int line;
|
||||
};
|
||||
|
||||
enum class TokenTag {
|
||||
KEYWORD, NAME, INTEGER, NUMBER, OPEN_BRACKET, CLOSE_BRACKET, STRING,
|
||||
OPERATOR, COMMA, SEMICOLON, UNEXPECTED, COMMENT
|
||||
};
|
||||
|
||||
struct Token {
|
||||
TokenTag tag;
|
||||
std::string text;
|
||||
Location start;
|
||||
Location end;
|
||||
|
||||
Token(TokenTag tag, std::string text, Location start, Location end)
|
||||
: tag(tag),
|
||||
text(std::move(text)),
|
||||
start(std::move(start)),
|
||||
end(std::move(end)) {
|
||||
}
|
||||
};
|
||||
|
||||
bool is_lua_keyword(std::string_view view);
|
||||
|
||||
std::vector<Token> tokenize(std::string_view file, std::string_view source);
|
||||
std::vector<devtools::Token> tokenize(
|
||||
std::string_view file, std::string_view source
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user