source: code/trunk/vendor/github.com/alecthomas/chroma/v2/lexers/bashsession.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: 571 bytes
Line 
1package lexers
2
3import (
4 . "github.com/alecthomas/chroma/v2" // nolint
5)
6
7// BashSession lexer.
8var BashSession = Register(MustNewLexer(
9 &Config{
10 Name: "BashSession",
11 Aliases: []string{"bash-session", "console", "shell-session"},
12 Filenames: []string{".sh-session"},
13 MimeTypes: []string{"text/x-sh"},
14 EnsureNL: true,
15 },
16 bashsessionRules,
17))
18
19func bashsessionRules() Rules {
20 return Rules{
21 "root": {
22 {`^((?:\[[^]]+@[^]]+\]\s?)?[#$%>])(\s*)(.*\n?)`, ByGroups(GenericPrompt, Text, Using("Bash")), nil},
23 {`^.+\n?`, GenericOutput, nil},
24 },
25 }
26}
Note: See TracBrowser for help on using the repository browser.