|
|
@ -8,7 +8,7 @@ |
|
|
|
#define JSON_JOB_H |
|
|
|
#define JSON_JOB_H |
|
|
|
|
|
|
|
|
|
|
|
#include <cstddef> // size_t |
|
|
|
#include <cstddef> // size_t |
|
|
|
#include <string> |
|
|
|
#include <string_view> |
|
|
|
#include <vector> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
|
|
|
|
#include "util/json/lexer.h" |
|
|
|
#include "util/json/lexer.h" |
|
|
@ -19,7 +19,7 @@ class Value; |
|
|
|
|
|
|
|
|
|
|
|
class Job { |
|
|
|
class Job { |
|
|
|
public: |
|
|
|
public: |
|
|
|
Job(const std::string& input); |
|
|
|
Job(std::string_view input); |
|
|
|
virtual ~Job(); |
|
|
|
virtual ~Job(); |
|
|
|
|
|
|
|
|
|
|
|
enum class Color { |
|
|
|
enum class Color { |
|
|
@ -36,13 +36,13 @@ public: |
|
|
|
void printErrorLine(Token token, const char* message); |
|
|
|
void printErrorLine(Token token, const char* message); |
|
|
|
|
|
|
|
|
|
|
|
bool success() const { return m_success; } |
|
|
|
bool success() const { return m_success; } |
|
|
|
const std::string& input() const { return m_input; } |
|
|
|
std::string_view input() const { return m_input; } |
|
|
|
std::vector<Token>* tokens() { return &m_tokens; } |
|
|
|
std::vector<Token>* tokens() { return &m_tokens; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool m_success { true }; |
|
|
|
bool m_success { true }; |
|
|
|
|
|
|
|
|
|
|
|
std::string m_input; |
|
|
|
std::string_view m_input; |
|
|
|
size_t m_lineNumbersWidth { 0 }; |
|
|
|
size_t m_lineNumbersWidth { 0 }; |
|
|
|
|
|
|
|
|
|
|
|
std::vector<Token> m_tokens; |
|
|
|
std::vector<Token> m_tokens; |
|
|
|