3 pygments.lexers.fortran |
3 pygments.lexers.fortran |
4 ~~~~~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Lexers for Fortran languages. |
6 Lexers for Fortran languages. |
7 |
7 |
8 :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
11 |
12 import re |
12 import re |
13 |
13 |
153 (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), |
153 (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double), |
154 (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), |
154 (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single), |
155 ], |
155 ], |
156 |
156 |
157 'nums': [ |
157 'nums': [ |
158 (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer), |
158 (r'\d+(?![.e])(_([1-9]|[a-z]\w*))?', Number.Integer), |
159 (r'[+-]?\d*\.\d+([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float), |
159 (r'[+-]?\d*\.\d+([ed][-+]?\d+)?(_([1-9]|[a-z]\w*))?', Number.Float), |
160 (r'[+-]?\d+\.\d*([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float), |
160 (r'[+-]?\d+\.\d*([ed][-+]?\d+)?(_([1-9]|[a-z]\w*))?', Number.Float), |
161 (r'[+-]?\d+(\.\d*)?[ed][-+]?\d+(_[a-z]\w+)?', Number.Float), |
161 (r'[+-]?\d+(\.\d*)?[ed][-+]?\d+(_([1-9]|[a-z]\w*))?', Number.Float), |
162 ], |
162 ], |
163 } |
163 } |
164 |
164 |
165 |
165 |
166 class FortranFixedLexer(RegexLexer): |
166 class FortranFixedLexer(RegexLexer): |