Georg Brandl avatar Georg Brandl committed e4baaa6

Closes #864: fix Prolog numeric literals.

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}|'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.