diff options
author | Georg Brandl <georg@python.org> | 2010-11-26 10:35:54 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-11-26 10:35:54 +0100 |
commit | 737de77b6ea81a34253af5a2ef7de0dd660a85bb (patch) | |
tree | a66efef20cb5c2542de36b7e605ef039c0d19463 | |
parent | 725f264b1221d48faecb50df4c654a1a3dec5f9b (diff) | |
download | pygments-737de77b6ea81a34253af5a2ef7de0dd660a85bb.tar.gz |
Support unsigned/long long literals in C/C++ (#613).
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | pygments/lexers/compiled.py | 16 |
2 files changed, 10 insertions, 8 deletions
@@ -53,6 +53,8 @@ Version 1.4 - Small PHP lexer string escaping fix (#515). +- Support unsigned/long long literals in C/C++ (#613). + Version 1.3.1 ------------- diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 6c1ac5a6..a3f85adb 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -55,11 +55,11 @@ class CLexer(RegexLexer): 'statements': [ (r'L?"', String, 'string'), (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), - (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float), (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), - (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex), - (r'0[0-7]+[Ll]?', Number.Oct), - (r'\d+[Ll]?', Number.Integer), + (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex), + (r'0[0-7]+[LlUu]*', Number.Oct), + (r'\d+[LlUu]*', Number.Integer), (r'\*/', Error), (r'[~!%^&*+=|?:<>/-]', Operator), (r'[()\[\],.]', Punctuation), @@ -180,11 +180,11 @@ class CppLexer(RegexLexer): (r'[{}]', Punctuation), (r'L?"', String, 'string'), (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char), - (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float), (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), - (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex), - (r'0[0-7]+[Ll]?', Number.Oct), - (r'\d+[Ll]?', Number.Integer), + (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex), + (r'0[0-7]+[LlUu]*', Number.Oct), + (r'\d+[LlUu]*', Number.Integer), (r'\*/', Error), (r'[~!%^&*+=|?:<>/-]', Operator), (r'[()\[\],.;]', Punctuation), |