mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add syntax highlighting (WIP)
This commit is contained in:
parent
ce1e9f76cf
commit
ed3865964b
16 changed files with 168 additions and 43 deletions
|
|
@ -214,10 +214,14 @@ std::string_view BasicParser::readUntil(char c) {
|
|||
return source.substr(start, pos - start);
|
||||
}
|
||||
|
||||
std::string_view BasicParser::readUntil(std::string_view s) {
|
||||
std::string_view BasicParser::readUntil(std::string_view s, bool nothrow) {
|
||||
int start = pos;
|
||||
size_t found = source.find(s, pos);
|
||||
if (found == std::string::npos) {
|
||||
if (nothrow) {
|
||||
pos = source.size();
|
||||
return source.substr(start);
|
||||
}
|
||||
throw error(util::quote(std::string(s))+" expected");
|
||||
}
|
||||
skip(found - pos);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue