use crate::syntax::{HighlightKind, Language};
pub static PYTHON: Language = Language {
name: "python",
extensions: &["py", "pyi", "pyw"],
filenames: &[],
keywords: &[
"and", "as", "assert", "async", "await", "break", "case", "class", "continue", "def",
"del", "elif", "else", "except", "finally", "for", "from", "global", "if", "import", "in",
"is", "lambda", "match", "nonlocal", "not", "or", "pass", "raise", "return", "try",
"while", "with", "yield",
],
types: &[
"bool",
"bytearray",
"bytes",
"complex",
"dict",
"float",
"frozenset",
"int",
"list",
"object",
"set",
"str",
"tuple",
"type",
"Any",
"Callable",
"Dict",
"Iterable",
"Iterator",
"List",
"Optional",
"Sequence",
"Set",
"Tuple",
"Union",
],
constants: &[
"True",
"False",
"None",
"NotImplemented",
"Ellipsis",
"self",
"cls",
"__name__",
"__file__",
],
line_comment: Some("#"),
block_comment: Some((r#"""""#, r#"""""#)),
nested_block_comments: false,
macro_suffix: false,
capitalised_types: true,
extra_rules: &[
(r"^\s*@[A-Za-z_][\w.]*", HighlightKind::Attribute),
(r"'''[^']*'''", HighlightKind::Comment),
(
r#"(?:[fFrRbBuU]{1,2})?"(?:[^"\\]|\\.)*"|(?:[fFrRbBuU]{1,2})?'(?:[^'\\]|\\.)*'"#,
HighlightKind::String,
),
],
prose: false,
};