diff options
author | Gaurav Jain <gaurav@gauravjain.org> | 2014-04-17 22:04:35 -0400 |
---|---|---|
committer | Gaurav Jain <gaurav@gauravjain.org> | 2014-04-17 22:04:35 -0400 |
commit | 9b44e016296ec1a1a43ffd513417d6d82c4ef35b (patch) | |
tree | c623d4f8b812c3ab26901fd94b1414aa49228fc5 /pygments/lexers/compiled.py | |
parent | 84b7c8aca975566dde86fc90a23d49353e534265 (diff) | |
download | pygments-9b44e016296ec1a1a43ffd513417d6d82c4ef35b.tar.gz |
Add support for kind paramter for integer and real types
Integers and reals can have an optional kind parameter specified with an underscore. This could have the format of any variable name. Additionally added example file to demonstrate usage.
Diffstat (limited to 'pygments/lexers/compiled.py')
-rw-r--r-- | pygments/lexers/compiled.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 947282dd..82af5426 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -1622,9 +1622,9 @@ class FortranLexer(RegexLexer): ], 'nums': [ - (r'\d+(?![.Ee])', Number.Integer), - (r'[+-]?\d*\.\d+([eE][-+]?\d+)?', Number.Float), - (r'[+-]?\d+\.\d*([eE][-+]?\d+)?', Number.Float), + (r'\d+(?![.Ee])(_[a-z][a-z0-9_]+)?', Number.Integer), + (r'[+-]?\d*\.\d+([eE][-+]?\d+)?(_[a-z][a-z0-9_]+)?', Number.Float), + (r'[+-]?\d+\.\d*([eE][-+]?\d+)?(_[a-z][a-z0-9_]+)?', Number.Float), ], } |