Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revise fortran fixed format lexer to recognize comments using the "!"…
… mark in columns 1-5 and columns > 6. Remove incorrect "0" label being a comment.
  • Loading branch information
smf007 authored and alecthomas committed Jun 21, 2022
1 parent 9a038fb commit 298b727
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lexers/fortran_fixed.go
Expand Up @@ -19,18 +19,18 @@ var FortranFixed = Register(MustNewLexer(
"root": {
{`[C*].*\n`, Comment, nil},
{`#.*\n`, CommentPreproc, nil},
{`[\t ]*!.*\n`, Comment, nil},
{` {0,4}!.*\n`, Comment, nil},
{`(.{5})`, NameLabel, Push("cont-char")},
{`.*\n`, Using("Fortran"), nil},
},
"cont-char": {
{` `, Text, Push("code")},
{`0`, Comment, Push("code")},
{` `, TextWhitespace, Push("code")},
{`.`, GenericStrong, Push("code")},
},
"code": {
{`(.{66})(.*)(\n)`, ByGroups(Using("Fortran"), Comment, Text), Push("root")},
{`.*\n`, Using("Fortran"), Push("root")},
{`(.{66})(.*)(\n)`, ByGroups(Using("Fortran"), Comment, TextWhitespace), Push("root")},
{`(.*)(!.*)(\n)`, ByGroups(Using("Fortran"), Comment, TextWhitespace), Push("root")},
{`(.*)(\n)`, ByGroups(Using("Fortran"), TextWhitespace), Push("root")},
Default(Push("root")),
},
}
Expand Down

0 comments on commit 298b727

Please sign in to comment.