Fortran highlighting: revert changes in fortran lexer

Issue #1423 new
Anonymous created an issue

Since compiled.py has been split into several sub lexers for each language (2.0 release), a few modifications have been introduced in FortranLexer class.

In particular, Name replaces Name.Variable style which is far from perfect as Name has no particular formatting in most of the styles.

Most troublesome is the second change in the Punctuation regexp that prevents the identification of .true. or .false. booleans.

diff -r 7941677dc77d pygments/lexers/fortran.py
--- a/pygments/lexers/fortran.py        Mon Mar 13 19:16:03 2017 +0000
+++ b/pygments/lexers/fortran.py        Tue Mar 06 15:26:39 2018 +0100
@@ -43,7 +43,7 @@
             (r'!.*\n', Comment),
             include('strings'),
             include('core'),
-            (r'[a-z][\w$]*', Name),
+            (r'[a-z][\w$]*', Name.Variable),
             include('nums'),
             (r'[\s]+', Text),
         ],
@@ -88,7 +88,7 @@

             (r'(::)', Keyword.Declaration),

-            (r'[()\[\],:&%;.]', Punctuation),
+            (r'[()\[\],:&%;]', Punctuation),
             # Intrinsics
             (words((
                 'Abort', 'Abs', 'Access', 'AChar', 'ACos', 'ACosH', 'AdjustL',

Comments (0)

  1. Log in to comment