Fortran highlighting: revert changes in fortran lexer

Issue #1423 new
Anonymous created an issue

Since 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/
--- a/pygments/lexers/        Mon Mar 13 19:16:03 2017 +0000
+++ b/pygments/lexers/        Tue Mar 06 15:26:39 2018 +0100
@@ -43,7 +43,7 @@
             (r'!.*\n', Comment),
-            (r'[a-z][\w$]*', Name),
+            (r'[a-z][\w$]*', Name.Variable),
             (r'[\s]+', Text),
@@ -88,7 +88,7 @@

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

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

Comments (0)

  1. Log in to comment