[PATCH] D46508: [llvm-rc] Allow optional commas between the string table index and value
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 7 13:32:05 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL331669: [llvm-rc] Allow optional commas between the string table index and value (authored by mstorsjo, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D46508?vs=145415&id=145531#toc
Repository:
rL LLVM
https://reviews.llvm.org/D46508
Files:
llvm/trunk/test/tools/llvm-rc/Inputs/tag-stringtable-basic.rc
llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
Index: llvm/trunk/test/tools/llvm-rc/Inputs/tag-stringtable-basic.rc
===================================================================
--- llvm/trunk/test/tools/llvm-rc/Inputs/tag-stringtable-basic.rc
+++ llvm/trunk/test/tools/llvm-rc/Inputs/tag-stringtable-basic.rc
@@ -4,9 +4,10 @@
0 "a"
}
+// Commas are optional, so we make sure to test both cases.
STRINGTABLE {
- 1 "b"
- 16 "bb"
+ 1, "b"
+ 16, "bb"
}
STRINGTABLE
Index: llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
===================================================================
--- llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
+++ llvm/trunk/tools/llvm-rc/ResourceScriptParser.cpp
@@ -573,6 +573,7 @@
// Some examples in documentation suggest that there might be a comma in
// between, however we strictly adhere to the single statement definition.
ASSIGN_OR_RETURN(IDResult, readInt());
+ consumeOptionalType(Kind::Comma);
ASSIGN_OR_RETURN(StrResult, readString());
Table->addString(*IDResult, *StrResult);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46508.145531.patch
Type: text/x-patch
Size: 1029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180507/660f5d99/attachment.bin>
More information about the llvm-commits
mailing list