{ "scopeName": "source.python", "name": "Python", "fileTypes": [ "cpy", "gyp", "gypi", "kv", "py", "pyw", "pyi", "rpy", "SConscript", "SConstruct", "Sconstruct", "sconstruct", "Snakefile", "smk", "tac", "wscript", "wsgi" ], "firstLineMatch": "^#![ \\t]*/.*\\bpython[\\d\\.]*\\b", "injections": { "L:source.python meta.embedded.sql": { "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_char" } ] } }, "patterns": [ { "include": "#line_comments" }, { "include": "#language_variables" }, { "match": "\\b(?i:(0x\\h*)L)", "name": "constant.numeric.integer.long.hexadecimal.python" }, { "match": "\\b(?i:(0x\\h*))", "name": "constant.numeric.integer.hexadecimal.python" }, { "match": "\\b(?i:(0o?[0-7]+)L)", "name": "constant.numeric.integer.long.octal.python" }, { "match": "\\b(?i:(0o?[0-7]+))", "name": "constant.numeric.integer.octal.python" }, { "match": "\\b(?i:(0b[01]+)L)", "name": "constant.numeric.integer.long.binary.python" }, { "match": "\\b(?i:(0b[01]+))", "name": "constant.numeric.integer.binary.python" }, { "match": "\\b(?i:(((\\d+(\\.(?=[^a-zA-Z_])\\d*)?|(?<=[^0-9a-zA-Z_])\\.\\d+)(e[\\-\\+]?\\d+)?))J)", "name": "constant.numeric.complex.python" }, { "match": "\\b(?i:(\\d+\\.\\d*(e[\\-\\+]?\\d+)?))(?=[^a-zA-Z_])", "name": "constant.numeric.float.python" }, { "match": "(?<=[^0-9a-zA-Z_])(?i:(\\.\\d+(e[\\-\\+]?\\d+)?))", "name": "constant.numeric.float.python" }, { "match": "\\b(?i:(\\d+e[\\-\\+]?\\d+))", "name": "constant.numeric.float.python" }, { "match": "\\b(?i:([1-9]+[0-9]*|0)L)", "name": "constant.numeric.integer.long.decimal.python" }, { "match": "\\b([1-9]+[0-9]*|0)", "name": "constant.numeric.integer.decimal.python" }, { "captures": { "1": { "name": "storage.modifier.global.python" } }, "match": "\\b(global)\\b" }, { "captures": { "1": { "name": "storage.modifier.nonlocal.python" } }, "match": "\\b(nonlocal)\\b" }, { "captures": { "1": { "name": "keyword.control.import.python" }, "2": { "name": "keyword.control.import.from.python" } }, "match": "\\b(?:(import)|(from))\\b" }, { "comment": "keywords that delimit flow conditionals", "name": "keyword.control.conditional.python", "match": "\\b(if|elif|else)\\b" }, { "comment": "keywords that delimit an exception", "name": "keyword.control.exception.python", "match": "\\b(except|finally|try|raise)\\b" }, { "comment": "keywords that delimit loops", "name": "keyword.control.repeat.python", "match": "\\b(for|while)\\b" }, { "comment": "keywords that alter flow from within a block", "name": "keyword.control.statement.python", "match": "\\b(with|break|continue|pass|return|yield(\\s+from)?|await)\\b" }, { "comment": "keyword operators that evaluate to True or False", "match": "\\b(and|in|is|not|or)\\b", "name": "keyword.operator.logical.python" }, { "captures": { "1": { "name": "keyword.other.python" } }, "comment": "keywords that haven't fit into other groups (yet).", "match": "\\b(as|assert|del|exec|print)\\b" }, { "match": "<>", "name": "invalid.deprecated.operator.python" }, { "match": "<\\=|>\\=|\\=\\=|<|>|\\!\\=", "name": "keyword.operator.comparison.python" }, { "match": "\\+\\=|-\\=|\\*\\=|/\\=|//\\=|%\\=|&\\=|\\|\\=|\\^\\=|>>\\=|<<\\=|\\*\\*\\=", "name": "keyword.operator.assignment.augmented.python" }, { "match": "\\+|\\-|\\*|\\*\\*|/|//|%|<<|>>|&|\\||\\^|~", "name": "keyword.operator.arithmetic.python" }, { "match": "\\=", "name": "keyword.operator.assignment.python" }, { "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\\s*\\:)", "beginCaptures": { "1": { "name": "storage.type.class.python" } }, "contentName": "entity.name.type.class.python", "end": "\\s*(:)", "endCaptures": { "1": { "name": "punctuation.section.class.begin.python" } }, "name": "meta.class.old-style.python", "patterns": [ { "include": "#entity_name_class" } ] }, { "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\\s*\\()", "beginCaptures": { "1": { "name": "storage.type.class.python" } }, "end": "(\\))\\s*(?:(\\:)|(.*$\\n?))", "endCaptures": { "1": { "name": "punctuation.definition.inheritance.end.python" }, "2": { "name": "punctuation.section.class.begin.python" }, "3": { "name": "invalid.illegal.missing-section-begin.python" } }, "name": "meta.class.python", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "contentName": "entity.name.type.class.python", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#entity_name_class" } ] }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.inheritance.begin.python" } }, "contentName": "meta.class.inheritance.python", "end": "(?=\\)|:)", "patterns": [ { "begin": "(?<=\\(|,)\\s*", "contentName": "entity.other.inherited-class.python", "end": "\\s*(?:(,)|(?=\\)))", "endCaptures": { "1": { "name": "punctuation.separator.inheritance.python" } }, "patterns": [ { "include": "$self" } ] } ] } ] }, { "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9])", "beginCaptures": { "1": { "name": "storage.type.class.python" } }, "end": "(\\()|(\\s*$\\n?|#.*$\\n?)", "endCaptures": { "1": { "name": "punctuation.definition.inheritance.begin.python" }, "2": { "name": "invalid.illegal.missing-inheritance.python" } }, "name": "meta.class.python", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "contentName": "entity.name.type.class.python", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#entity_name_function" } ] } ] }, { "begin": "^\\s*(?:(async)\\s+)?(def)\\s+(?=[A-Za-z_][A-Za-z0-9_]*)", "beginCaptures": { "1": { "name": "storage.modifier.async.python" }, "2": { "name": "storage.type.function.python" } }, "end": ":", "endCaptures": { "0": { "name": "punctuation.definition.function.begin.python" } }, "name": "meta.function.python", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "contentName": "entity.name.function.python", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#entity_name_function" } ] }, { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.python" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.python" } }, "contentName": "meta.function.parameters.python", "patterns": [ { "include": "#line_comments" }, { "begin": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\s*(?:(:)\\s*([a-zA-Z_][\\w_]*))?\\s*(=)\\s*", "beginCaptures": { "1": { "name": "keyword.operator.unpacking.arguments.python" }, "2": { "name": "variable.parameter.function.python" }, "3": { "name": "punctuation.separator.python" }, "4": { "name": "storage.type.python" }, "5": { "name": "keyword.operator.assignment.python" } }, "end": "(?!\\G)", "patterns": [ { "include": "$self" } ] }, { "match": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\s*(?:(:)\\s*([a-zA-Z_][\\w_]*))?", "captures": { "1": { "name": "keyword.operator.unpacking.arguments.python" }, "2": { "name": "variable.parameter.function.python" }, "3": { "name": "punctuation.separator.python" }, "4": { "name": "storage.type.python" } } }, { "match": ",", "name": "punctuation.separator.parameters.python" } ] }, { "match": "(->)\\s*([A-Za-z_][\\w_]*)(?=\\s*:)", "captures": { "1": { "name": "keyword.operator.function-annotation.python" }, "2": { "name": "storage.type.python" } } } ] }, { "begin": "\\b(lambda)\\b", "beginCaptures": { "1": { "name": "storage.type.function.inline.python" } }, "end": ":", "endCaptures": { "0": { "name": "punctuation.definition.function.begin.python" } }, "name": "meta.function.inline.python", "patterns": [ { "begin": "\\G", "end": "(?=\\:)", "contentName": "meta.function.inline.parameters.python", "patterns": [ { "begin": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\s*(=)\\s*", "beginCaptures": { "1": { "name": "keyword.operator.unpacking.arguments.python" }, "2": { "name": "variable.parameter.function.python" }, "3": { "name": "keyword.operator.assignment.python" } }, "end": "(?!\\G)", "patterns": [ { "include": "$self" } ] }, { "match": "(?:(\\*{0,2})|\\b)([a-zA-Z_][\\w_]*)\\b", "captures": { "1": { "name": "keyword.operator.unpacking.arguments.python" }, "2": { "name": "variable.parameter.function.python" } } }, { "match": ",", "name": "punctuation.separator.parameters.python" } ] } ] }, { "begin": "^\\s*(?=@\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*\\s*\\()", "comment": "a decorator may be a function call which returns a decorator.", "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.arguments.end.python" } }, "name": "meta.function.decorator.python", "patterns": [ { "begin": "(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*\\s*\\()", "beginCaptures": { "1": { "name": "punctuation.definition.decorator.python" } }, "contentName": "entity.name.function.decorator.python", "end": "(?=\\s*\\()", "patterns": [ { "include": "#dotted_name" } ] }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.arguments.begin.python" } }, "contentName": "meta.function.decorator.arguments.python", "end": "(?=\\))", "patterns": [ { "include": "#keyword_arguments" }, { "include": "$self" } ] } ] }, { "begin": "^\\s*(?=@\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*)", "contentName": "entity.name.function.decorator.python", "end": "(?=\\s|$\\n?|#)", "name": "meta.function.decorator.python", "patterns": [ { "begin": "(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)", "beginCaptures": { "1": { "name": "punctuation.definition.decorator.python" } }, "end": "(?=\\s|$\\n?|#)", "patterns": [ { "include": "#dotted_name" } ] } ] }, { "include": "#function_calls" }, { "include": "#method_calls" }, { "include": "#objects" }, { "include": "#properties" }, { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*\\s*\\[)", "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.arguments.end.python" } }, "name": "meta.item-access.python", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*\\s*\\[)", "end": "(?=\\s*\\[)", "patterns": [ { "include": "#dotted_name" } ] }, { "begin": "(\\[)", "beginCaptures": { "1": { "name": "punctuation.definition.arguments.begin.python" } }, "contentName": "meta.item-access.arguments.python", "end": "(?=\\])", "patterns": [ { "include": "$self" } ] } ] }, { "begin": "(?<=\\)|\\])\\s+(\\[)", "beginCaptures": { "1": { "name": "punctuation.definition.arguments.begin.python" } }, "contentName": "meta.item-access.arguments.python", "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.arguments.end.python" } }, "name": "meta.item-access.python", "patterns": [ { "include": "$self" } ] }, { "captures": { "1": { "name": "storage.type.class.python" } }, "match": "\\b(class)\\b" }, { "include": "#line_continuation" }, { "match": "\\b(None|True|False|Ellipsis|NotImplemented)\\b", "name": "constant.language.python" }, { "include": "#string_quoted_single" }, { "include": "#string_quoted_double" }, { "begin": "(\\()", "end": "(\\))", "patterns": [ { "include": "$self" } ] }, { "captures": { "1": { "name": "punctuation.definition.list.begin.python" }, "2": { "name": "meta.empty-list.python" }, "3": { "name": "punctuation.definition.list.end.python" } }, "match": "(\\[)(\\s*(\\]))\\b" }, { "begin": "(\\[)", "beginCaptures": { "1": { "name": "punctuation.definition.list.begin.python" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.list.end.python" } }, "name": "meta.structure.list.python", "patterns": [ { "begin": "(?<=\\[|\\,)\\s*(?![\\],])", "contentName": "meta.structure.list.item.python", "end": "\\s*(?:(,)|(?=\\]))", "endCaptures": { "1": { "name": "punctuation.separator.list.python" } }, "patterns": [ { "include": "$self" } ] } ] }, { "captures": { "1": { "name": "punctuation.definition.tuple.begin.python" }, "2": { "name": "meta.empty-tuple.python" }, "3": { "name": "punctuation.definition.tuple.end.python" } }, "match": "(\\()(\\s*(\\)))", "name": "meta.structure.tuple.python" }, { "captures": { "1": { "name": "punctuation.definition.dictionary.begin.python" }, "2": { "name": "meta.empty-dictionary.python" }, "3": { "name": "punctuation.definition.dictionary.end.python" } }, "match": "(\\{)(\\s*(\\}))", "name": "meta.structure.dictionary.python" }, { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.definition.dictionary.begin.python" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.definition.dictionary.end.python" } }, "name": "meta.structure.dictionary.python", "patterns": [ { "begin": "(?<=\\{|\\,|^)\\s*(?![\\},])", "contentName": "meta.structure.dictionary.key.python", "end": "\\s*(?:(?=\\})|(\\:))", "endCaptures": { "1": { "name": "punctuation.separator.valuepair.dictionary.python" } }, "patterns": [ { "include": "$self" } ] }, { "begin": "(?<=\\:|^)\\s*", "contentName": "meta.structure.dictionary.value.python", "end": "\\s*(?:(?=\\})|(,))", "endCaptures": { "1": { "name": "punctuation.separator.dictionary.python" } }, "patterns": [ { "include": "$self" } ] } ] } ], "repository": { "builtin_exceptions": { "match": "(?x)\\b(\n\t\t\t\t(\n\t\t\t\t\tArithmetic|Assertion|Attribute|BlockingIO|BrokenPipe|Buffer|ChildProcess|\n\t\t\t\t\tConnection(Aborted|Refused|Reset)?|EOF|Environment|FileExists|\n\t\t\t\t\tFileNotFound|FloatingPoint|Interrupted|IO|IsADirectoryError|\n\t\t\t\t\tImport|Indentation|Index|Key|Lookup|Memory|Name|NotADirectory|\n\t\t\t\t\tNotImplemented|OS|Overflow|Permission|ProcessLookup|Recursion|Reference|\n\t\t\t\t\tRuntime|Standard|Syntax|System|Tab|Timeout|Type|UnboundLocal|\n\t\t\t\t\tUnicode(Encode|Decode|Translate)?|Value|VMS|Windows|ZeroDivision\n\t\t\t\t)Error|\n\t\t\t\t((Pending)?Deprecation|Runtime|Syntax|User|Future|Import|Unicode|Bytes)?Warning|\n\t\t\t\t(Base)?Exception|\n\t\t\t\tSystemExit|StopAsyncIteration|StopIteration|NotImplemented|KeyboardInterrupt|GeneratorExit\n\t\t\t)\\b", "name": "support.type.exception.python" }, "builtin_functions": { "match": "(?x)\\b(__import__|abs|all|any|ascii|bin|bool|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|file|long|raw_input|reduce|reload|unichr|unicode|xrange|apply|buffer|coerce|intern|execfile)\\b", "name": "support.function.builtin.python" }, "builtin_types": { "match": "(?x)\\b(\n\t\t\t\tbasestring|bool|buffer|bytearray|bytes|complex|dict|float|frozenset|int|\n\t\t\t\tlist|long|memoryview|object|range|set|slice|str|tuple|unicode|xrange\n\t\t\t)\\b", "name": "support.type.python" }, "docstrings": { "patterns": [ { "begin": "^\\s*(?=[uU]?[rR]?\"\"\")", "end": "(?<=\"\"\")", "name": "comment.block.python", "patterns": [ { "include": "#string_quoted_double" } ] }, { "begin": "^\\s*(?=[uU]?[rR]?''')", "end": "(?<=''')", "name": "comment.block.python", "patterns": [ { "include": "#string_quoted_single" } ] } ] }, "function_calls": { "patterns": [ { "begin": "(?:([A-Za-z_][A-Za-z0-9_]*)|(?<=\\)|\\]))\\s*(\\()", "beginCaptures": { "1": { "patterns": [ { "include": "#builtin_functions" }, { "include": "#function_names" } ] }, "2": { "name": "punctuation.definition.arguments.begin.bracket.round.python" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.arguments.end.bracket.round.python" } }, "name": "meta.function-call.python", "contentName": "meta.function-call.arguments.python", "patterns": [ { "include": "#keyword_arguments" }, { "match": ",", "name": "punctuation.separator.arguments.python" }, { "include": "$self" } ] } ] }, "dotted_name": { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*)", "end": "(?![A-Za-z0-9_\\.])", "patterns": [ { "begin": "(\\.)(?=[A-Za-z_][A-Za-z0-9_]*)", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#magic_function_names" }, { "include": "#magic_variable_names" }, { "include": "#illegal_names" }, { "include": "#generic_names" } ] }, { "begin": "(?=^])? # fill followed by align\n [+\\- ]? # sign (space at the end is intentional)\n \\#? # alternate form\n 0?\n \\d* # width\n [_,]? # grouping option\n (\\.\\d+)? # precision\n [bcdeEfFgGnosxX%]? # type\n )?\n}", "name": "constant.other.placeholder.python" }, "regular_expressions": { "comment": "Changed disabled to 1 to turn off syntax highlighting in “r” strings.", "disabled": 0, "patterns": [ { "include": "source.regexp.python" } ] }, "string_formatting": { "patterns": [ { "match": "(?x)\n%\n(\\([a-zA-Z_]+\\))? # mapping key\n[#0+\\- ]? # conversion flags (space at the end is intentional)\n(\\d+|\\*)? # minimum field width\n(\\.(\\d+|\\*))? # precision\n[hlL]? # length modifier\n[diouxXeEfFgGcrs%] # conversion type", "name": "constant.other.placeholder.python" }, { "match": "(?x)\n{\n (?:\n (?:\n \\d # integer\n |\n [a-zA-Z_]\\w* # identifier\n )\n (?:\n \\.[a-zA-Z_]\\w* # attribute name\n |\n \\[[^\\]]+\\] # element index\n )*\n )?\n (?:![rsa])? # conversion\n (?:\n # Yup, this is disgusting. But top-level format specifiers can have nested replacement fields.\n :\n (?:(?:.|({[^}]*}))?(?:[<>=^]|({[^}]*})))? # fill followed by align\n (?:[+\\- ]|({[^}]*}))? # sign (space at the end is intentional)\n (?:\\#|({[^}]*}))? # alternate form\n (?:0|({[^}]*}))?\n (?:\\d+|({[^}]*}))? # width\n (?:[_,]|({[^}]*}))? # grouping option\n (?:\\.(?:\\d+|({[^}]*}))|({[^}]*}))? # precision\n (?:[bcdeEfFgGnosxX%]|({[^}]*}))? # type\n )?\n}", "name": "constant.other.placeholder.python", "captures": { "1": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "2": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "3": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "4": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "5": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "6": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "7": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "8": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "9": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "10": { "patterns": [ { "include": "#nested_replacement_field" } ] } } } ] }, "string_interpolation": { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.definition.interpolation.begin.bracket.curly.python" } }, "end": "(?x)(?!\\G)\n(\n (?:![rsa])? # conversion\n (?:\n # Yup, this is disgusting. But top-level format specifiers can have nested replacement fields.\n :\n (?:(?:.|({[^}]*}))?(?:[<>=^]|({[^}]*})))? # fill followed by align\n (?:[+\\- ]|({[^}]*}))? # sign (space at the end is intentional)\n (?:\\#|({[^}]*}))? # alternate form\n (?:0|({[^}]*}))?\n (?:\\d+|({[^}]*}))? # width\n (?:[_,]|({[^}]*}))? # grouping option\n (?:\\.(?:\\d+|({[^}]*}))|({[^}]*}))? # precision\n (?:[bcdeEfFgGnosxX%]|({[^}]*}))? # type\n )?\n)\n(})", "endCaptures": { "1": { "name": "constant.other.placeholder.python" }, "2": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "3": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "4": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "5": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "6": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "7": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "8": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "9": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "10": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "11": { "patterns": [ { "include": "#nested_replacement_field" } ] }, "12": { "name": "punctuation.definition.interpolation.end.bracket.curly.python" } }, "name": "meta.interpolation.python", "contentName": "meta.embedded.python", "patterns": [ { "match": "\\\\", "name": "invalid.illegal.backslash.python" }, { "include": "$self" } ] }, "string_quoted_double": { "patterns": [ { "begin": "([uU]r)(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "single quoted unicode-raw string", "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.unicode-raw-regex.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_unicode_char" }, { "include": "#escaped_char" }, { "include": "#regular_expressions" } ] }, { "begin": "([uU]R)(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "single quoted unicode-raw string without regular expression highlighting", "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.unicode-raw.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_unicode_char" }, { "include": "#escaped_char" } ] }, { "begin": "(r)(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted raw string", "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.raw-regex.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_char" }, { "include": "#regular_expressions" } ] }, { "begin": "(R)(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted raw string", "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.raw.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_char" } ] }, { "begin": "([uU])(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted unicode string", "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.unicode.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_unicode_char" }, { "include": "#escaped_char" } ] }, { "begin": "([fF])(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.format.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_interpolation" }, { "match": "}", "name": "invalid.illegal.closing-curly-bracket.python" } ] }, { "begin": "([rR][fF]|[fF][rR])(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.raw-format.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_interpolation" }, { "match": "}", "name": "invalid.illegal.closing-curly-bracket.python" } ] }, { "begin": "([bB])(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.binary.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_formatting" }, { "match": "[^\\x{01}-\\x{7f}]", "name": "invalid.illegal.character-out-of-range.python" } ] }, { "begin": "([rR][bB]|[bB][rR])(\"\"\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.raw-binary.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_formatting" }, { "match": "[^\\x{01}-\\x{7f}]", "name": "invalid.illegal.character-out-of-range.python" } ] }, { "captures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" }, "3": { "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_unicode_char" }, { "include": "#escaped_char" }, { "include": "#regular_expressions" } ] }, "4": { "name": "punctuation.definition.string.end.python" } }, "comment": "double-quoted raw string", "match": "([uU]r)(\")((?:[^\"\\\\]|\\\\.)*)(\")", "name": "string.quoted.double.single-line.unicode-raw-regex.python" }, { "begin": "([uU]R)(\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double-quoted raw string", "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.unicode-raw.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_unicode_char" }, { "include": "#escaped_char" } ] }, { "captures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" }, "3": { "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_char" }, { "include": "#regular_expressions" } ] }, "4": { "name": "punctuation.definition.string.end.python" } }, "comment": "double-quoted raw string", "match": "(r)(\")((?:[^\"\\\\]|\\\\.)*)(\")", "name": "string.quoted.double.single-line.raw-regex.python" }, { "begin": "(R)(\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double-quoted raw string", "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.raw.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_char" } ] }, { "begin": "([uU])(\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted unicode string", "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.unicode.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_unicode_char" }, { "include": "#escaped_char" } ] }, { "begin": "([fF])(\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.format.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_interpolation" }, { "match": "}", "name": "invalid.illegal.closing-curly-bracket.python" } ] }, { "begin": "([rR][fF]|[fF][rR])(\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.raw-format.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_interpolation" }, { "match": "}", "name": "invalid.illegal.closing-curly-bracket.python" } ] }, { "begin": "([bB])(\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.binary.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_formatting" }, { "match": "[^\\x{01}-\\x{7f}]", "name": "invalid.illegal.character-out-of-range.python" } ] }, { "begin": "([rR][bB]|[bB][rR])(\")", "beginCaptures": { "1": { "name": "storage.type.string.python" }, "2": { "name": "punctuation.definition.string.begin.python" } }, "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.raw-binary.python", "patterns": [ { "include": "#escaped_char" }, { "include": "#string_formatting" }, { "match": "[^\\x{01}-\\x{7f}]", "name": "invalid.illegal.character-out-of-range.python" } ] }, { "begin": "(\"\"\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted string", "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.python", "patterns": [ { "begin": "(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! /)|CREATE|REPLACE|ALTER|WITH))", "name": "meta.embedded.sql", "end": "(?=\\s*\"\"\")", "patterns": [ { "include": "source.sql" } ] } ] }, { "begin": "(\")(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! /)|CREATE|REPLACE|ALTER|WITH))", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted string", "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.sql.python", "contentName": "meta.embedded.sql", "patterns": [ { "include": "source.sql" } ] }, { "begin": "(\"\"\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted string", "end": "((?<=\"\"\")(\")\"\"|\"\"\")", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" } }, "name": "string.quoted.double.block.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_char" } ] }, { "begin": "(\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.python" } }, "comment": "double quoted string", "end": "((?<=\")(\")|\")|(\\n)", "endCaptures": { "1": { "name": "punctuation.definition.string.end.python" }, "2": { "name": "meta.empty-string.double.python" }, "3": { "name": "invalid.illegal.unclosed-string.python" } }, "name": "string.quoted.double.single-line.python", "patterns": [ { "include": "#string_formatting" }, { "include": "#escaped_char" } ] } ] }, "string_quoted_single": { "patterns": [ { "captures": { "1": { "name": "punctuation.definition.string.begin.python" }, "2": { "name": "punctuation.definition.string.end.python" }, "3": { "name": "meta.empty-string.single.python" } }, "match": "(?