deepseek-rust-cli 1.20.6

A lightweight, high-speed autonomous CLI system agent port of DeepSeek CLI.
Documentation
//! Keyword lists for syntax highlighting.
//!
//! Each language has a static slice of keywords that are highlighted
//! in blue when detected in code output.

use super::colorizer::CodeLang;

/// Return the keyword list for a given language.
pub fn get_keywords(lang: CodeLang) -> &'static [&'static str] {
    match lang {
        CodeLang::Rust => &[
            "fn", "let", "mut", "struct", "enum", "impl", "trait", "pub", "use", "mod", "as",
            "async", "await", "break", "const", "continue", "crate", "dyn", "else", "extern",
            "false", "for", "if", "in", "loop", "match", "move", "priv", "ref", "return", "self",
            "Self", "static", "super", "type", "unsafe", "where", "while", "yield", "Ok", "Err",
            "Some", "None",
        ],
        CodeLang::Python => &[
            "def", "class", "import", "from", "as", "return", "if", "elif", "else", "for", "while",
            "in", "not", "and", "or", "is", "with", "try", "except", "finally", "raise", "pass",
            "break", "continue", "yield", "lambda", "async", "await", "del", "global", "nonlocal",
            "assert", "print",
        ],
        CodeLang::JavaScript | CodeLang::TypeScript => &[
            "function",
            "const",
            "let",
            "var",
            "return",
            "if",
            "else",
            "for",
            "while",
            "do",
            "switch",
            "case",
            "break",
            "continue",
            "new",
            "this",
            "class",
            "extends",
            "import",
            "export",
            "default",
            "from",
            "async",
            "await",
            "try",
            "catch",
            "throw",
            "typeof",
            "instanceof",
            "of",
            "in",
            "yield",
            "interface",
            "type",
            "enum",
            "implements",
        ],
        CodeLang::Go => &[
            "func",
            "var",
            "const",
            "type",
            "struct",
            "interface",
            "map",
            "chan",
            "package",
            "import",
            "return",
            "if",
            "else",
            "for",
            "range",
            "switch",
            "case",
            "default",
            "break",
            "continue",
            "go",
            "select",
            "defer",
            "fallthrough",
        ],
        CodeLang::Java => &[
            "class",
            "interface",
            "enum",
            "extends",
            "implements",
            "import",
            "package",
            "public",
            "private",
            "protected",
            "static",
            "final",
            "abstract",
            "synchronized",
            "volatile",
            "transient",
            "native",
            "strictfp",
            "return",
            "if",
            "else",
            "for",
            "while",
            "do",
            "switch",
            "case",
            "break",
            "continue",
            "new",
            "this",
            "super",
            "try",
            "catch",
            "throw",
            "throws",
            "finally",
            "void",
            "int",
            "long",
            "double",
            "float",
            "boolean",
            "byte",
            "short",
            "char",
        ],
        CodeLang::C | CodeLang::Cpp => &[
            "if",
            "else",
            "for",
            "while",
            "do",
            "switch",
            "case",
            "break",
            "continue",
            "return",
            "struct",
            "enum",
            "union",
            "typedef",
            "const",
            "static",
            "extern",
            "volatile",
            "register",
            "auto",
            "sizeof",
            "goto",
            "void",
            "int",
            "long",
            "double",
            "float",
            "char",
            "short",
            "unsigned",
            "signed",
            "class",
            "namespace",
            "template",
            "typename",
            "virtual",
            "override",
            "public",
            "private",
            "protected",
            "new",
            "delete",
            "nullptr",
        ],
        CodeLang::Shell => &[
            "if", "then", "else", "elif", "fi", "for", "while", "do", "done", "case", "esac", "in",
            "function", "return", "local", "export", "unset", "readonly", "declare", "eval",
            "exec", "exit", "source", "echo", "cd", "ls", "cat", "grep", "sed", "awk",
        ],
        CodeLang::Sql => &[
            // Uppercase
            "SELECT", "FROM", "WHERE", "INSERT", "UPDATE", "DELETE", "CREATE", "DROP", "ALTER",
            "TABLE", "INDEX", "VIEW", "INTO", "VALUES", "SET", "JOIN", "LEFT", "RIGHT", "INNER",
            "OUTER", "ON", "AS", "AND", "OR", "NOT", "NULL", "IS", "IN", "LIKE", "BETWEEN",
            "ORDER", "BY", "GROUP", "HAVING", "LIMIT", "OFFSET", "UNION", "ALL", "DISTINCT",
            "COUNT", "SUM", "AVG", "MIN", "MAX", "EXISTS", "CASE", "WHEN", "THEN", "END",
            // Lowercase
            "select", "from", "where", "insert", "update", "delete", "create", "drop", "alter",
            "table", "index", "view", "into", "values", "set", "join", "left", "right", "inner",
            "outer", "on", "as", "and", "or", "not", "null", "is", "in", "like", "between",
            "order", "by", "group", "having", "limit", "offset", "union", "all", "distinct",
            "count", "sum", "avg", "min", "max", "exists", "case", "when", "then", "end",
        ],
        CodeLang::Html => &[
            "html", "head", "body", "div", "span", "p", "a", "img", "ul", "ol", "li", "table",
            "tr", "td", "th", "form", "input", "button", "script", "style", "link", "meta",
            "title", "h1", "h2", "h3", "h4", "h5", "h6", "header", "footer", "nav", "main",
            "section", "article", "aside", "DOCTYPE",
        ],
        CodeLang::Css => &[
            "color",
            "background",
            "margin",
            "padding",
            "border",
            "font",
            "display",
            "flex",
            "grid",
            "position",
            "width",
            "height",
            "top",
            "left",
            "right",
            "bottom",
            "z-index",
            "overflow",
            "opacity",
            "transform",
            "transition",
            "animation",
            "@media",
            "@import",
            "@keyframes",
        ],
        CodeLang::Json | CodeLang::Toml | CodeLang::Yaml => &[],
        CodeLang::Markdown => &[],
        CodeLang::Generic => &[],
    }
}