summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/alecthomas/chroma/lexers/t/tex.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/alecthomas/chroma/lexers/t/tex.go')
-rw-r--r--vendor/github.com/alecthomas/chroma/lexers/t/tex.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/alecthomas/chroma/lexers/t/tex.go b/vendor/github.com/alecthomas/chroma/lexers/t/tex.go
index f1010c4a89..f9413b370b 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/t/tex.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/t/tex.go
@@ -6,14 +6,18 @@ import (
)
// Tex lexer.
-var TeX = internal.Register(MustNewLexer(
+var TeX = internal.Register(MustNewLazyLexer(
&Config{
Name: "TeX",
Aliases: []string{"tex", "latex"},
Filenames: []string{"*.tex", "*.aux", "*.toc"},
MimeTypes: []string{"text/x-tex", "text/x-latex"},
},
- Rules{
+ texRules,
+))
+
+func texRules() Rules {
+ return Rules{
"general": {
{`%.*?\n`, Comment, nil},
{`[{}]`, NameBuiltin, nil},
@@ -52,5 +56,5 @@ var TeX = internal.Register(MustNewLexer(
{`\*`, Keyword, nil},
Default(Pop(1)),
},
- },
-))
+ }
+}