#7187 internal error; unhandled char constant \e. Support \e char literal support by clang,gcc,tcc
This commit is contained in:
parent
86c9387987
commit
5ddc5c0798
|
@ -375,6 +375,9 @@ MathLib::bigint MathLib::characterLiteralToLongNumber(const std::string& str)
|
||||||
case 'b':
|
case 'b':
|
||||||
c = '\b';
|
c = '\b';
|
||||||
break;
|
break;
|
||||||
|
case 'e':
|
||||||
|
c = 0x1B; // clang, gcc, tcc interpret this as 0x1B - escape character
|
||||||
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
c = '\f';
|
c = '\f';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -280,6 +280,7 @@ private:
|
||||||
// END Implementation-specific results
|
// END Implementation-specific results
|
||||||
#endif
|
#endif
|
||||||
ASSERT_EQUALS((int)('\0'), MathLib::toLongNumber("'\\0'"));
|
ASSERT_EQUALS((int)('\0'), MathLib::toLongNumber("'\\0'"));
|
||||||
|
ASSERT_EQUALS(0x1B, MathLib::toLongNumber("'\\e'"));
|
||||||
ASSERT_EQUALS((int)('\r'), MathLib::toLongNumber("'\\r'"));
|
ASSERT_EQUALS((int)('\r'), MathLib::toLongNumber("'\\r'"));
|
||||||
ASSERT_EQUALS((int)('\x12'), MathLib::toLongNumber("'\\x12'"));
|
ASSERT_EQUALS((int)('\x12'), MathLib::toLongNumber("'\\x12'"));
|
||||||
// may cause some compile problems: ASSERT_EQUALS((int)('\x123'), MathLib::toLongNumber("'\\x123'"));
|
// may cause some compile problems: ASSERT_EQUALS((int)('\x123'), MathLib::toLongNumber("'\\x123'"));
|
||||||
|
|
Loading…
Reference in New Issue