...
1 package l
2
3 import (
4 . "github.com/alecthomas/chroma"
5 "github.com/alecthomas/chroma/lexers/internal"
6 )
7
8
9 var Lighttpd = internal.Register(MustNewLazyLexer(
10 &Config{
11 Name: "Lighttpd configuration file",
12 Aliases: []string{"lighty", "lighttpd"},
13 Filenames: []string{},
14 MimeTypes: []string{"text/x-lighttpd-conf"},
15 },
16 lighttpdRules,
17 ))
18
19 func lighttpdRules() Rules {
20 return Rules{
21 "root": {
22 {`#.*\n`, CommentSingle, nil},
23 {`/\S*`, Name, nil},
24 {`[a-zA-Z._-]+`, Keyword, nil},
25 {`\d+\.\d+\.\d+\.\d+(?:/\d+)?`, LiteralNumber, nil},
26 {`[0-9]+`, LiteralNumber, nil},
27 {`=>|=~|\+=|==|=|\+`, Operator, nil},
28 {`\$[A-Z]+`, NameBuiltin, nil},
29 {`[(){}\[\],]`, Punctuation, nil},
30 {`"([^"\\]*(?:\\.[^"\\]*)*)"`, LiteralStringDouble, nil},
31 {`\s+`, Text, nil},
32 },
33 }
34 }
35
View as plain text