Last change
on this file since 67 was 67, checked in by Izuru Yakumo, 23 months ago |
Use vendored modules
Signed-off-by: Izuru Yakumo <yakumo.izuru@…>
|
File size:
495 bytes
|
Line | |
---|
1 | package lexers
|
---|
2 |
|
---|
3 | import (
|
---|
4 | "strings"
|
---|
5 | )
|
---|
6 |
|
---|
7 | // Zed lexer.
|
---|
8 | func 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 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.