[llvm] [llvm-rc] Accept filenames provided as multiple string literals (PR #68881)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 13 07:29:39 PDT 2023
================
@@ -238,7 +238,27 @@ Expected<StringRef> RCParser::readString() {
Expected<StringRef> RCParser::readFilename() {
if (!isNextTokenKind(Kind::String) && !isNextTokenKind(Kind::Identifier))
return getExpectedError("string");
- return read().value();
+ const RCToken &Token = read();
+ StringRef Str = Token.value();
+ if (Token.kind() != Kind::String)
+ return Str;
+ while (isNextTokenKind(Kind::String)) {
+ const RCToken &NextToken = read();
+ StringRef Next = NextToken.value();
+ bool IsWide = Str.starts_with_insensitive("L");
+ if (IsWide)
+ Str = Str.drop_front();
+ if (Next.starts_with_insensitive("L"))
+ Next = Next.drop_front();
----------------
cjacek wrote:
This could use `consume_front_insensitive`.
https://github.com/llvm/llvm-project/pull/68881
More information about the llvm-commits
mailing list