mirror of
https://github.com/jorenchik/mdemory.git
synced 2026-03-22 00:26:21 +00:00
33 lines
570 B
C++
33 lines
570 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "result.h"
|
|
|
|
enum class TokenType {
|
|
TextFragment,
|
|
QuestionEnd,
|
|
MatchGroupEnd,
|
|
ElementDashStart,
|
|
ElementPlusStart,
|
|
ElementOrderModifier,
|
|
Cooldown,
|
|
CooldownStart,
|
|
CooldownEnd,
|
|
StartOfFile,
|
|
EndOfFile
|
|
};
|
|
|
|
struct Token {
|
|
TokenType tokenType;
|
|
std::string content;
|
|
int32_t row;
|
|
int32_t column;
|
|
|
|
std::string ToString() const;
|
|
static std::string ToString(const TokenType* ttype);
|
|
};
|
|
|
|
Result<std::vector<Token>> tokenizeMdem(const std::string& fileRunes);
|