Commits

Georg Brandl committed e4baaa6

Closes #864: fix Prolog numeric literals.

  • Participants
  • Parent commits cd1cfa7

Comments (0)

Files changed (2)

 - 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).
 
 - 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

pygments/lexers/compiled.py

             (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}|'