mirror of
https://github.com/gbdev/rgbds.git
synced 2026-05-09 19:39:36 +00:00
Keep more non-declaration initialization within the for loop clause
This commit is contained in:
+4
-6
@@ -192,15 +192,16 @@ static yy::parser::symbol_type parseAnyNumber(int c) {
|
||||
|
||||
static yy::parser::symbol_type parseString() {
|
||||
LexerStackEntry &context = lexerStack.back();
|
||||
int c = context.file.sgetc();
|
||||
std::string str;
|
||||
for (; c != '"'; c = context.file.sgetc()) {
|
||||
for (int c = context.file.sgetc();; c = context.file.sgetc()) {
|
||||
if (c == EOF || isNewline(c)) {
|
||||
scriptError("Unterminated string");
|
||||
break;
|
||||
}
|
||||
context.file.sbumpc();
|
||||
if (c == '\\') {
|
||||
if (c == '"') {
|
||||
break;
|
||||
} else if (c == '\\') {
|
||||
c = context.file.sgetc();
|
||||
if (c == EOF || isNewline(c)) {
|
||||
scriptError("Unterminated string");
|
||||
@@ -220,9 +221,6 @@ static yy::parser::symbol_type parseString() {
|
||||
}
|
||||
str.push_back(c);
|
||||
}
|
||||
if (c == '"') {
|
||||
context.file.sbumpc();
|
||||
}
|
||||
return yy::parser::make_string(std::move(str));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user