source: code/trunk/vendor/github.com/alecthomas/chroma/v2/lexers/bash.go@ 67

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: 349 bytes
Line 
1package lexers
2
3import (
4 "regexp"
5)
6
7// TODO(moorereason): can this be factored away?
8var bashAnalyserRe = regexp.MustCompile(`(?m)^#!.*/bin/(?:env |)(?:bash|zsh|sh|ksh)`)
9
10func init() { // nolint: gochecknoinits
11 Get("bash").SetAnalyser(func(text string) float32 {
12 if bashAnalyserRe.FindString(text) != "" {
13 return 1.0
14 }
15 return 0.0
16 })
17}
Note: See TracBrowser for help on using the repository browser.