Commit 954f9918 authored by Milian Wolff's avatar Milian Wolff

C++11: Support number separators in floating point literals.

parent 04edb1ed
...@@ -146,6 +146,7 @@ constexpr auto c = 0x123; // hex ...@@ -146,6 +146,7 @@ constexpr auto c = 0x123; // hex
constexpr auto c = 0x1234'5678'9abc; // hex w/ delimiters constexpr auto c = 0x1234'5678'9abc; // hex w/ delimiters
constexpr auto z = 0b1010110001110; // binary w/ delimiters constexpr auto z = 0b1010110001110; // binary w/ delimiters
constexpr auto z1 = 0b1'0101'1000'1110; // binary w/ delimiters constexpr auto z1 = 0b1'0101'1000'1110; // binary w/ delimiters
constexpr auto segmentedDouble = 1'2.4'57'8e12'1;
constexpr auto binary_invalid = 0b012; constexpr auto binary_invalid = 0b012;
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<!ENTITY punctuators ":&ns_punctuators;"> <!ENTITY punctuators ":&ns_punctuators;">
<!-- printf-like format strings conversion specifiers --> <!-- printf-like format strings conversion specifiers -->
<!ENTITY convspec "diouxXeEfFgGaAcsP&#37;"> <!ENTITY convspec "diouxXeEfFgGaAcsP&#37;">
<!-- part of a number with separator -->
<!ENTITY floatPart "[0-9](?:'?[0-9]+)*">
]> ]>
<language <language
name="ISO C++" name="ISO C++"
...@@ -191,7 +193,7 @@ ...@@ -191,7 +193,7 @@
<!-- NOTE Order is important! --> <!-- NOTE Order is important! -->
<RegExpr attribute="Hex" context="#stay" String="[\+\-]?0x[0-9A-Fa-f](?:'?[0-9A-Fa-f]+)*(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> <RegExpr attribute="Hex" context="#stay" String="[\+\-]?0x[0-9A-Fa-f](?:'?[0-9A-Fa-f]+)*(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" />
<RegExpr attribute="Binary" context="#stay" String="0[Bb][01](?:'?[01]+)*(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> <RegExpr attribute="Binary" context="#stay" String="0[Bb][01](?:'?[01]+)*(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" />
<RegExpr attribute="Float" context="#stay" String="[\+\-]?(?:[0-9]+[Ee][\+\-]?[0-9]+|([0-9]+\.|\.[0-9]+|[0-9]+\.[0-9]+)(?:[Ee][\+\-]?[0-9]+)?)[FfLl]?" /> <RegExpr attribute="Float" context="#stay" String="[\+\-]?(?:&floatPart;[Ee][\+\-]?&floatPart;|(&floatPart;\.|\.&floatPart;|&floatPart;\.&floatPart;)(?:[Ee][\+\-]?&floatPart;)?)[FfLl]?" />
<RegExpr attribute="Octal" context="#stay" String="[\+\-]?0'?[0-7](?:'?[0-7]+)*(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> <RegExpr attribute="Octal" context="#stay" String="[\+\-]?0'?[0-7](?:'?[0-7]+)*(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" />
<RegExpr attribute="Decimal" context="#stay" String="[\+\-]?(?:0|[1-9](?:'?[0-9]+)*)(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> <RegExpr attribute="Decimal" context="#stay" String="[\+\-]?(?:0|[1-9](?:'?[0-9]+)*)(?:[Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" />
<RegExpr attribute="Error" context="#stay" String="[\+\-]?(?:0x?|[1-9][0-9]*)[0-9A-Za-z][_0-9A-Za-z]*\b" /> <RegExpr attribute="Error" context="#stay" String="[\+\-]?(?:0x?|[1-9][0-9]*)[0-9A-Za-z][_0-9A-Za-z]*\b" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment