diff options
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | pygments/lexers/compiled.py | 10 |
2 files changed, 12 insertions, 2 deletions
@@ -24,6 +24,8 @@ Version 1.7 - Pygments will now recognize "vim" modelines when guessing the lexer for a file based on content (PR#118). +- The NameHighlightFilter now works with any Name.* token type (#790). + - Python 3 lexer: add new exceptions from PEP 3151. - Opa lexer: add new keywords (PR#170). @@ -48,7 +50,7 @@ Version 1.7 - Haxe lexer: rewrite and support for Haxe 3 (PR#174). -- The NameHighlightFilter now works with any Name.* token type (#790). +- Prolog lexer: add different kinds of numeric literals (#864). Version 1.6 diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index c3b0909d..75ace35e 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -1608,7 +1608,15 @@ class PrologLexer(RegexLexer): (r'^#.*', Comment.Single), (r'/\*', Comment.Multiline, 'nested-comment'), (r'%.*', Comment.Single), - (r'[0-9]+', Number), + # character literal + (r'0\'.', String.Char), + (r'0b[01]+', Number.Bin), + (r'0o[0-7]+', Number.Oct), + (r'0x[0-9a-fA-F]+', Number.Hex), + # literal with prepended base + (r'\d\d?\'[a-zA-Z0-9]+', Number.Integer), + (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+', Number.Integer), (r'[\[\](){}|.,;!]', Punctuation), (r':-|-->', Punctuation), (r'"(?:\\x[0-9a-fA-F]+\\|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|' |