BasicParser now uses string_view

This commit is contained in:
MihailRis
2024-05-08 23:32:04 +03:00
parent 65e85f362c
commit 5da2a30326
9 changed files with 45 additions and 43 deletions
+6 -6
View File
@@ -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_