Removed un-needed comments and fixed merge issue.

This commit is contained in:
Andrew Woloszyn 2015-10-14 13:21:50 -04:00 committed by David Neto
parent 3e69cd1b9f
commit f08c679e97
3 changed files with 11 additions and 10 deletions

View File

@ -107,7 +107,6 @@ spv_result_t spvTextToLiteral(const char* textValue, spv_literal_t* pLiteral) {
pLiteral->type = spv_literal_type_t(99);
if (isString || numPeriods > 1 || (isSigned && len == 1)) {
// TODO(dneto): Allow escaping.
if (len < 2 || textValue[0] != '"' || textValue[len - 1] != '"')
return SPV_FAILED_MATCH;
bool escaping = false;

View File

@ -27,12 +27,15 @@ but the assembler does not enforce this rule.
The opcode names and expected operands are described in section 3 of
the SPIR-V specification. An operand is one of:
* a literal integer: A decimal integer, or a hexadecimal integer
(indicated by a leading `0x`).
* a literal integer: A decimal integer, or a hexadecimal integer.
A hexadecimal integer is indicated by a leading `0x` or `0X`. A hex
integer supplied for a signed integer value will be sign-extended.
For example, `0xffff` supplied as the literal for an `OpConstant`
on a signed 16-bit integer type will be interpreted as the value `-1`.
* a literal floating point number.
* a literal string.
* A literal string is everything following a double-quote `"` until the
following un-escaped double-quote, this includes special characters such as
following un-escaped double-quote. This includes special characters such as
newlines.
* A backslash `\` may be used to escape characters in the string. The `\`
may be used to escape a double-quote or a `\` but is simply ignored when
@ -156,10 +159,11 @@ instruction.)
The assembler processes the tokens encountered in alternate parsing mode as
follows:
* If the token is a number literal, it outputs that number as one or more words,
as defined in the SPIR-V specification for Literal Number. The number must
fit within the unsigned 32-bit range. All formats supported by `strtoul()`
are accepted.
* If the token is a number literal, since context may be lost, the number
is interpreted as a 32-bit value and output as a single word. In order to
specify multiple-word literals in alternate-parsing mode, further uses of
`!<integer>` tokens may be required.
All formats supported by `strtoul()` are accepted.
* If the token is a string literal, it outputs a sequence of words representing
the string as defined in the SPIR-V specification for Literal String.
* If the token is an ID, it outputs the ID's internal number.

View File

@ -116,7 +116,6 @@ TEST_P(GoodStringTest, GoodStrings) {
EXPECT_STREQ(std::get<1>(GetParam()), l.value.str);
}
#define CASE(NAME) spv::Decoration##NAME, #NAME
INSTANTIATE_TEST_CASE_P(
TextLiteral, GoodStringTest,
::testing::ValuesIn(std::vector<std::pair<const char*, const char*>>{
@ -134,7 +133,6 @@ INSTANTIATE_TEST_CASE_P(
{"\"this \\\" and this \\\\ and \\\U00E4BAB2\"",
"this \" and this \\ and \U00E4BAB2"}
}));
#undef CASE
TEST(TextLiteral, StringTooLong) {
spv_literal_t l;