diff options
Diffstat (limited to 'vendor/github.com/alecthomas/chroma/v2/lexers/fortran_fixed.go')
| -rw-r--r-- | vendor/github.com/alecthomas/chroma/v2/lexers/fortran_fixed.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/alecthomas/chroma/v2/lexers/fortran_fixed.go b/vendor/github.com/alecthomas/chroma/v2/lexers/fortran_fixed.go new file mode 100644 index 0000000..d93ac1e --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/v2/lexers/fortran_fixed.go @@ -0,0 +1,38 @@ +package lexers + +import ( + . "github.com/alecthomas/chroma/v2" // nolint +) + +// FortranFixed lexer. +var FortranFixed = Register(MustNewLexer( + &Config{ + Name: "FortranFixed", + Aliases: []string{"fortranfixed"}, + Filenames: []string{"*.f", "*.F"}, + MimeTypes: []string{"text/x-fortran"}, + NotMultiline: true, + CaseInsensitive: true, + }, + func() Rules { + return Rules{ + "root": { + {`[C*].*\n`, Comment, nil}, + {`#.*\n`, CommentPreproc, nil}, + {`[\t ]*!.*\n`, Comment, nil}, + {`(.{5})`, NameLabel, Push("cont-char")}, + {`.*\n`, Using("Fortran"), nil}, + }, + "cont-char": { + {` `, Text, Push("code")}, + {`0`, Comment, Push("code")}, + {`.`, GenericStrong, Push("code")}, + }, + "code": { + {`(.{66})(.*)(\n)`, ByGroups(Using("Fortran"), Comment, Text), Push("root")}, + {`.*\n`, Using("Fortran"), Push("root")}, + Default(Push("root")), + }, + } + }, +)) |
