Genex: Make EQUAL support upper case binary literals

As C++11, python, D and java do.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf

Add test for uppercase hex literals.
parent 6eb32181
 ... @@ -215,18 +215,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode ... @@ -215,18 +215,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode bool flipSign = false; bool flipSign = false; const char *lhs = parameters.c_str(); const char *lhs = parameters.c_str(); if (cmHasLiteralPrefix(lhs, "0b")) if (cmHasLiteralPrefix(lhs, "0b") || cmHasLiteralPrefix(lhs, "0B")) { { base = 2; base = 2; lhs += 2; lhs += 2; } } if (cmHasLiteralPrefix(lhs, "-0b")) if (cmHasLiteralPrefix(lhs, "-0b") || cmHasLiteralPrefix(lhs, "-0B")) { { base = 2; base = 2; lhs += 3; lhs += 3; flipSign = true; flipSign = true; } } if (cmHasLiteralPrefix(lhs, "+0b")) if (cmHasLiteralPrefix(lhs, "+0b") || cmHasLiteralPrefix(lhs, "+0B")) { { base = 2; base = 2; lhs += 3; lhs += 3; ... @@ -249,18 +249,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode ... @@ -249,18 +249,18 @@ static const struct EqualNode : public cmGeneratorExpressionNode flipSign = false; flipSign = false; const char *rhs = parameters.c_str(); const char *rhs = parameters.c_str(); if (cmHasLiteralPrefix(rhs, "0b")) if (cmHasLiteralPrefix(rhs, "0b") || cmHasLiteralPrefix(rhs, "0B")) { { base = 2; base = 2; rhs += 2; rhs += 2; } } if (cmHasLiteralPrefix(rhs, "-0b")) if (cmHasLiteralPrefix(rhs, "-0b") || cmHasLiteralPrefix(rhs, "-0B")) { { base = 2; base = 2; rhs += 3; rhs += 3; flipSign = true; flipSign = true; } } if (cmHasLiteralPrefix(rhs, "+0b")) if (cmHasLiteralPrefix(rhs, "+0b") || cmHasLiteralPrefix(rhs, "+0B")) { { base = 2; base = 2; rhs += 3; rhs += 3; ... ...
 ... @@ -199,7 +199,7 @@ add_custom_target(check-part3 ALL ... @@ -199,7 +199,7 @@ add_custom_target(check-part3 ALL -Dequal1=\$ -Dequal1=\$ -Dequal2=\$ -Dequal2=\$ -Dequal3=\$ -Dequal3=\$ -Dequal4=\$ -Dequal4=\$ -Dequal5=\$ -Dequal5=\$ -Dequal6=\$ -Dequal6=\$ -Dequal7=\$ -Dequal7=\$ ... @@ -208,15 +208,17 @@ add_custom_target(check-part3 ALL ... @@ -208,15 +208,17 @@ add_custom_target(check-part3 ALL -Dequal10=\$ -Dequal10=\$ -Dequal11=\$ -Dequal11=\$ -Dequal12=\$ -Dequal12=\$ -Dequal13=\$ -Dequal13=\$ -Dequal14=\$ -Dequal14=\$ -Dequal15=\$ -Dequal15=\$ -Dequal16=\$ -Dequal16=\$ -Dequal17=\$ -Dequal17=\$ -Dequal18=\$ -Dequal18=\$ -Dequal19=\$ -Dequal19=\$ -Dequal20=\$ -Dequal20=\$ -Dequal21=\$ -Dequal21=\$ -Dequal22=\$ -Dequal23=\$ -P \${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake -P \${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake COMMAND \${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" COMMAND \${CMAKE_COMMAND} -E echo "check done (part 3 of 3)" VERBATIM VERBATIM ... ...
 ... @@ -55,6 +55,8 @@ check(equal15 "1") ... @@ -55,6 +55,8 @@ check(equal15 "1") check(equal16 "1") check(equal16 "1") check(equal17 "0") check(equal17 "0") check(equal18 "1") check(equal18 "1") check(equal19 "1") check(equal19 "0") check(equal20 "0") check(equal20 "1") check(equal21 "1") check(equal21 "1") check(equal22 "0") check(equal23 "1")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!