summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/alecthomas/chroma/lexers/s/systemd.go')
-rw-r--r--vendor/github.com/alecthomas/chroma/lexers/s/systemd.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go b/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go
index 6b0884ec00..f70136c399 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/s/systemd.go
@@ -5,14 +5,18 @@ import (
"github.com/alecthomas/chroma/lexers/internal"
)
-var SYSTEMD = internal.Register(MustNewLexer(
+var SYSTEMD = internal.Register(MustNewLazyLexer(
&Config{
Name: "SYSTEMD",
Aliases: []string{"systemd"},
Filenames: []string{"*.service"},
MimeTypes: []string{"text/plain"},
},
- Rules{
+ systemdRules,
+))
+
+func systemdRules() Rules {
+ return Rules{
"root": {
{`\s+`, Text, nil},
{`[;#].*`, Comment, nil},
@@ -24,5 +28,5 @@ var SYSTEMD = internal.Register(MustNewLexer(
{`(.*?)(\\\n)`, ByGroups(LiteralString, Text), nil},
{`(.*)`, LiteralString, Pop(1)},
},
- },
-))
+ }
+}