Util: Move vector<Token> ownership to Job class

This commit is contained in:
Riyyi
2022-06-26 23:13:25 +02:00
parent bc01b34e58
commit 8fb1a1a8e9
7 changed files with 58 additions and 34 deletions
+3 -5
View File
@@ -42,13 +42,11 @@ struct Token {
// Lexical analyzer
class Lexer {
public:
Lexer(std::shared_ptr<Job> job);
Lexer(Job* job);
virtual ~Lexer();
void analyze();
const std::vector<Token>& tokens() const { return m_tokens; }
private:
char peek();
char peekNext();
@@ -60,13 +58,13 @@ private:
bool getNumber();
bool getLiteral();
std::shared_ptr<Job> m_job { nullptr };
Job* m_job { nullptr };
size_t m_index { 0 };
size_t m_column { 1 };
size_t m_line { 1 };
std::vector<Token> m_tokens;
std::vector<Token>* m_tokens { nullptr };
};
} // namespace Json