mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
BasicParser now uses string_view
This commit is contained in:
parent
65e85f362c
commit
5da2a30326
9 changed files with 45 additions and 43 deletions
|
|
@ -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_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue