Util: Only break Lexer string tokenization on unescaped "

This commit is contained in:
Riyyi
2022-07-01 11:11:42 +02:00
parent c1c9429a9d
commit 0aef4ee2c0
+1 -7
View File
@@ -180,12 +180,6 @@ bool Lexer::getString()
size_t column = m_column;
std::string symbol = "";
// Break on "\/ and any control character
std::string breakOnGrammar = "\"\\/";
for (size_t i = 0; i < 32; ++i) {
breakOnGrammar += i;
}
bool escape = false;
char character = consume();
for (;;) {
@@ -198,7 +192,7 @@ bool Lexer::getString()
continue;
}
if (!escape && breakOnGrammar.find(character) != std::string::npos) {
if (!escape && character == '"') {
break;
}