aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/alecthomas/chroma/v2/lexers/zed.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/alecthomas/chroma/v2/lexers/zed.go')
-rw-r--r--vendor/github.com/alecthomas/chroma/v2/lexers/zed.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/alecthomas/chroma/v2/lexers/zed.go b/vendor/github.com/alecthomas/chroma/v2/lexers/zed.go
new file mode 100644
index 0000000..aadc80f
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/v2/lexers/zed.go
@@ -0,0 +1,24 @@
1package lexers
2
3import (
4 "strings"
5)
6
7// Zed lexer.
8func init() { // nolint: gochecknoinits
9 Get("Zed").SetAnalyser(func(text string) float32 {
10 if strings.Contains(text, "definition ") && strings.Contains(text, "relation ") && strings.Contains(text, "permission ") {
11 return 0.9
12 }
13 if strings.Contains(text, "definition ") {
14 return 0.5
15 }
16 if strings.Contains(text, "relation ") {
17 return 0.5
18 }
19 if strings.Contains(text, "permission ") {
20 return 0.25
21 }
22 return 0.0
23 })
24}