use crate::syntax::{HighlightKind, Language};
pub static RUST: Language = Language {
name: "rust",
extensions: &["rs"],
filenames: &[],
keywords: &[
"as", "async", "await", "break", "const", "continue", "crate", "dyn", "else", "enum",
"extern", "fn", "for", "if", "impl", "in", "let", "loop", "match", "mod", "move", "mut",
"pub", "ref", "return", "self", "static", "struct", "super", "trait", "type", "union",
"unsafe", "use", "where", "while", "yield",
],
types: &[
"bool", "char", "f32", "f64", "i8", "i16", "i32", "i64", "i128", "isize", "str", "u8",
"u16", "u32", "u64", "u128", "usize", "String", "Vec", "Option", "Result", "Box", "Rc",
"Arc", "Cow", "HashMap", "HashSet", "BTreeMap", "VecDeque", "Self",
],
constants: &["true", "false", "None", "Some", "Ok", "Err"],
line_comment: Some("//"),
block_comment: Some(("/*", "*/")),
nested_block_comments: true,
macro_suffix: true,
capitalised_types: true,
extra_rules: &[
(r"///.*|//!.*", HighlightKind::Comment),
(r"#!?\[[^\]]*\]?", HighlightKind::Attribute),
(r##"r#*"[^"]*"#*"##, HighlightKind::String),
(r#"b"(?:[^"\\]|\\.)*""#, HighlightKind::String),
(r"b?'(?:[^'\\]|\\.)'", HighlightKind::String),
(r"'(?:static|_|[a-z][a-z0-9_]*)", HighlightKind::Type),
],
prose: false,
};