package lexers

import (
	
	

	
)

//go:embed embedded
var embedded embed.FS

// GlobalLexerRegistry is the global LexerRegistry of Lexers.
var GlobalLexerRegistry = func() *chroma.LexerRegistry {
	 := chroma.NewLexerRegistry()
	// index(reg)
	,  := fs.Glob(embedded, "embedded/*.xml")
	if  != nil {
		panic()
	}
	for ,  := range  {
		.Register(chroma.MustNewXMLLexer(embedded, ))
	}
	return 
}()

// Names of all lexers, optionally including aliases.
func ( bool) []string {
	return GlobalLexerRegistry.Names()
}

// Get a Lexer by name, alias or file extension.
//
// Note that this if there isn't an exact match on name or alias, this will
// call Match(), so it is not efficient.
func ( string) chroma.Lexer {
	return GlobalLexerRegistry.Get()
}

// MatchMimeType attempts to find a lexer for the given MIME type.
func ( string) chroma.Lexer {
	return GlobalLexerRegistry.MatchMimeType()
}

// Match returns the first lexer matching filename.
//
// Note that this iterates over all file patterns in all lexers, so it's not
// particularly efficient.
func ( string) chroma.Lexer {
	return GlobalLexerRegistry.Match()
}

// Register a Lexer with the global registry.
func ( chroma.Lexer) chroma.Lexer {
	return GlobalLexerRegistry.Register()
}

// Analyse text content and return the "best" lexer..
func ( string) chroma.Lexer {
	return GlobalLexerRegistry.Analyse()
}

// PlaintextRules is used for the fallback lexer as well as the explicit
// plaintext lexer.
func () chroma.Rules {
	return chroma.Rules{
		"root": []chroma.Rule{
			{`.+`, chroma.Text, nil},
			{`\n`, chroma.Text, nil},
		},
	}
}

// Fallback lexer if no other is found.
var Fallback chroma.Lexer = chroma.MustNewLexer(&chroma.Config{
	Name:      "fallback",
	Filenames: []string{"*"},
	Priority:  -1,
}, PlaintextRules)