Merge pull request #808 from simartin/ticket_7565
Ticket #7565: Handle numbers with several C++14 integer literals.
This commit is contained in:
commit
d7bf0f4e4e
|
@ -1280,6 +1280,8 @@ bool MathLib::isDigitSeparator(const std::string& iCode, std::string::size_type
|
||||||
case '~':
|
case '~':
|
||||||
case '=':
|
case '=':
|
||||||
return true;
|
return true;
|
||||||
|
case '\'':
|
||||||
|
return isDigitSeparator(iCode, i);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ private:
|
||||||
ASSERT_THROW(MathLib::normalizeCharacterLiteral("\\c"), InternalError);
|
ASSERT_THROW(MathLib::normalizeCharacterLiteral("\\c"), InternalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPP14DigitSeparators() { // Ticket #7137
|
void CPP14DigitSeparators() { // Ticket #7137, #7565
|
||||||
ASSERT(MathLib::isDigitSeparator("'", 0) == false);
|
ASSERT(MathLib::isDigitSeparator("'", 0) == false);
|
||||||
ASSERT(MathLib::isDigitSeparator("123'0;", 3));
|
ASSERT(MathLib::isDigitSeparator("123'0;", 3));
|
||||||
ASSERT(MathLib::isDigitSeparator("foo(1'2);", 5));
|
ASSERT(MathLib::isDigitSeparator("foo(1'2);", 5));
|
||||||
|
@ -1160,6 +1160,7 @@ private:
|
||||||
ASSERT(MathLib::isDigitSeparator("if (120|1'2) { char c = 'c'; }", 9));
|
ASSERT(MathLib::isDigitSeparator("if (120|1'2) { char c = 'c'; }", 9));
|
||||||
ASSERT(MathLib::isDigitSeparator("if (120%1'2) { char c = 'c'; }", 24) == false);
|
ASSERT(MathLib::isDigitSeparator("if (120%1'2) { char c = 'c'; }", 24) == false);
|
||||||
ASSERT(MathLib::isDigitSeparator("if (120%1'2) { char c = 'c'; }", 26) == false);
|
ASSERT(MathLib::isDigitSeparator("if (120%1'2) { char c = 'c'; }", 26) == false);
|
||||||
|
ASSERT(MathLib::isDigitSeparator("0b0000001'0010'01110", 14));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue