Fix unterminated strings in linkerscripts consuming their newline

This commit is contained in:
Rangi42
2025-07-16 09:59:48 -04:00
parent d8fc25ee43
commit cf6e5fec63
3 changed files with 9 additions and 2 deletions

View File

@@ -306,7 +306,9 @@ yy::parser::symbol_type yylex() {
} }
str.push_back(c); str.push_back(c);
} }
context.file.sbumpc(); // Consume the closing quote. if (c == '"') {
context.file.sbumpc();
}
return yy::parser::make_string(std::move(str)); return yy::parser::make_string(std::move(str));
} else if (c == '$') { } else if (c == '$') {

View File

@@ -1,2 +1,5 @@
rom0 rom0
"ROM0 "ROM0
romx 2
"ROM2 1K
"ROM2 1

View File

@@ -1,2 +1,4 @@
error: script-unterminated-string.link(2): Unterminated string error: script-unterminated-string.link(2): Unterminated string
Linking failed with 1 error error: script-unterminated-string.link(4): Unterminated string
error: script-unterminated-string.link(5): Unterminated string
Linking failed with 3 errors