egui_code_editor/syntax/
shell.rs

1use super::Syntax;
2use std::collections::BTreeSet;
3
4impl Syntax {
5    pub fn shell() -> Self {
6        Syntax {
7            language: "Shell",
8            case_sensitive: true,
9            comment: "#",
10            hyperlinks: BTreeSet::from(["http"]),
11            keywords: BTreeSet::from([
12                "echo", "read", "set", "unset", "readonly", "shift", "export", "if", "fi", "else",
13                "while", "do", "done", "for", "until", "case", "esac", "break", "continue", "exit",
14                "return", "trap", "wait", "eval", "exec", "ulimit", "umask",
15            ]),
16            comment_multiline: [": '", "'"],
17            types: BTreeSet::from([
18                "ENV",
19                "HOME",
20                "IFS",
21                "LANG",
22                "LC_ALL",
23                "LC_COLLATE",
24                "LC_CTYPE",
25                "LC_MESSAGES",
26                "LINENO",
27                "NLSPATH",
28                "PATH",
29                "PPID",
30                "PS1",
31                "PS2",
32                "PS4",
33                "PWD",
34            ]),
35            special: BTreeSet::from([
36                "alias", "bg", "cd", "command", "false", "fc", "fg", "getopts", "jobs", "kill",
37                "newgrp", "pwd", "read", "true", "umask", "unalias", "wait",
38            ]),
39        }
40    }
41}