BasicParser now uses string_view
This commit is contained in:
@@ -61,8 +61,8 @@ public:
|
||||
|
||||
parsing_error(
|
||||
std::string message,
|
||||
std::string filename,
|
||||
std::string source,
|
||||
std::string_view filename,
|
||||
std::string_view source,
|
||||
uint pos,
|
||||
uint line,
|
||||
uint linestart
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
|
||||
class BasicParser {
|
||||
protected:
|
||||
const std::string& filename;
|
||||
const std::string& source;
|
||||
std::string_view filename;
|
||||
std::string_view source;
|
||||
uint pos = 0;
|
||||
uint line = 1;
|
||||
uint linestart = 0;
|
||||
@@ -95,13 +95,13 @@ protected:
|
||||
parsing_error error(std::string message);
|
||||
|
||||
public:
|
||||
std::string readUntil(char c);
|
||||
std::string_view readUntil(char c);
|
||||
std::string parseName();
|
||||
bool hasNext();
|
||||
char peek();
|
||||
char nextChar();
|
||||
|
||||
BasicParser(const std::string& file, const std::string& source);
|
||||
BasicParser(std::string_view file, std::string_view source);
|
||||
};
|
||||
|
||||
#endif // CODERS_COMMONS_HPP_
|
||||
|
||||
Reference in New Issue
Block a user