...

Source file src/github.com/alecthomas/chroma/v2/lexers/dns.go

Documentation: github.com/alecthomas/chroma/v2/lexers

     1  package lexers
     2  
     3  import (
     4  	"regexp"
     5  )
     6  
     7  // TODO(moorereason): can this be factored away?
     8  var zoneAnalyserRe = regexp.MustCompile(`(?m)^@\s+IN\s+SOA\s+`)
     9  
    10  func init() { // nolint: gochecknoinits
    11  	Get("dns").SetAnalyser(func(text string) float32 {
    12  		if zoneAnalyserRe.FindString(text) != "" {
    13  			return 1.0
    14  		}
    15  		return 0.0
    16  	})
    17  }
    18  

View as plain text