{ "comment": "\n\ttodo:\n\t\tlist comprehension / generator comprehension scope.\n\t\t\n\t", "fileTypes": [ "pyx", "pxi", "pxd" ], "firstLineMatch": "^#!/.*\\bcython\\b", "keyEquivalent": "^~C", "name": "Cython", "patterns": [ { "begin": "(^[ \\t]+)?(?=#)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.cython" } }, "end": "(?!\\G)", "patterns": [ { "begin": "#", "beginCaptures": { "0": { "name": "punctuation.definition.comment.cython" } }, "end": "\\n", "name": "comment.line.number-sign.cython" } ] }, { "match": "\\b(?i:(0x[0-9A-Fa-f]*)L)", "name": "constant.numeric.integer.long.hexadecimal.cython" }, { "match": "\\b(?i:(0x[0-9A-Fa-f]*))", "name": "constant.numeric.integer.hexadecimal.cython" }, { "match": "\\b(?i:(0[0-7]+)L)", "name": "constant.numeric.integer.long.octal.cython" }, { "match": "\\b(0[0-7]+)", "name": "constant.numeric.integer.octal.cython" }, { "match": "\\b(?i:(((\\d+(\\.(?=[^a-zA-Z_])\\d*)?|(?<=[^0-9a-zA-Z_])\\.\\d+)(e[\\-\\+]?\\d+)?))J)", "name": "constant.numeric.complex.cython" }, { "match": "\\b(?i:(\\d+\\.\\d*(e[\\-\\+]?\\d+)?))(?=[^a-zA-Z_])", "name": "constant.numeric.float.cython" }, { "match": "(?<=[^0-9a-zA-Z_])(?i:(\\.\\d+(e[\\-\\+]?\\d+)?))", "name": "constant.numeric.float.cython" }, { "match": "\\b(?i:(\\d+e[\\-\\+]?\\d+))", "name": "constant.numeric.float.cython" }, { "match": "\\b(?i:([1-9]+[0-9]*|0)L)", "name": "constant.numeric.integer.long.decimal.cython" }, { "match": "\\b([1-9]+[0-9]*|0)", "name": "constant.numeric.integer.decimal.cython" }, { "captures": { "1": { "name": "storage.modifier.global.cython" } }, "match": "\\b(global)\\b" }, { "captures": { "1": { "name": "keyword.control.import.cython" }, "2": { "name": "keyword.control.import.from.cython" } }, "match": "\\b(?:(import|include)|(from))\\b" }, { "comment": "keywords that delimit flow blocks", "match": "\\b(elif|else|except|finally|for|if|try|while|with|IF|ELIF|ELSE)\\b", "name": "keyword.control.flow.cython" }, { "comment": "keywords that alter flow from within a block", "match": "\\b(break|continue|pass|raise|return|yield)\\b", "name": "keyword.control.flow.cython" }, { "comment": "keyword operators that evaluate to True or False", "match": "\\b(and|in|is|not|or)\\b", "name": "keyword.operator.logical.cython" }, { "captures": { "1": { "name": "keyword.other.cython" } }, "comment": "keywords that haven't fit into other groups (yet).", "match": "\\b(as|assert|del|exec|print)\\b" }, { "match": "\\b(asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\b", "name": "storage.type.cython" }, { "match": "<\\=|>\\=|\\=\\=|<|>|<>", "name": "keyword.operator.comparison.cython" }, { "match": "\\+\\=|-\\=|\\*\\=|/\\=|//\\=|%\\=|&\\=|\\|\\=|\\^\\=|>>\\=|<<\\=|\\*\\*\\=", "name": "keyword.operator.assignment.augmented.cython" }, { "match": "\\+|\\-|\\*|\\*\\*|/|//|%|<<|>>|&|\\||\\^|~", "name": "keyword.operator.arithmetic.cython" }, { "match": "\\=", "name": "keyword.operator.assignment.cython" }, { "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\\s*\\:)", "beginCaptures": { "1": { "name": "storage.type.class.cython" } }, "contentName": "entity.name.type.class.cython", "end": "\\s*(:)", "endCaptures": { "1": { "name": "punctuation.section.class.begin.cython" } }, "name": "meta.class.old-style.cython", "patterns": [ { "include": "#entity_name_class" } ] }, { "begin": "^\\s*(property)\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\\s*\\:)", "beginCaptures": { "1": { "name": "storage.type.property.cython" } }, "contentName": "entity.name.type.property.cython", "end": "\\s*(:)", "endCaptures": { "1": { "name": "punctuation.section.property.begin.cython" } }, "name": "meta.property.cython" }, { "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*\\s*\\()", "beginCaptures": { "1": { "name": "storage.type.class.cython" } }, "end": "(\\))\\s*(?:(\\:)|(.*$\\n?))", "endCaptures": { "1": { "name": "punctuation.definition.inheritance.end.cython" }, "2": { "name": "punctuation.section.class.begin.cython" }, "3": { "name": "invalid.illegal.missing-section-begin.cython" } }, "name": "meta.class.cython", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "contentName": "entity.name.type.class.cython", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#entity_name_class" } ] }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.inheritance.begin.cython" } }, "contentName": "meta.class.inheritance.cython", "end": "(?=\\)|:)", "patterns": [ { "begin": "(?<=\\(|,)\\s*", "contentName": "entity.other.inherited-class.cython", "end": "\\s*(?:(,)|(?=\\)))", "endCaptures": { "1": { "name": "punctuation.separator.inheritance.cython" } }, "patterns": [ { "include": "$self" } ] } ] } ] }, { "begin": "^\\s*(class)\\s+(?=[a-zA-Z_][a-zA-Z_0-9])", "beginCaptures": { "1": { "name": "storage.type.class.cython" } }, "end": "(\\()|\\s*($\\n?|#.*$\\n?)", "endCaptures": { "1": { "name": "punctuation.definition.inheritance.begin.cython" }, "2": { "name": "invalid.illegal.missing-inheritance.cython" } }, "name": "meta.class.cython", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "contentName": "entity.name.type.class.cython", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#entity_name_function" } ] } ] }, { "begin": "^\\s*(def)\\s+(?=[A-Za-z_][A-Za-z0-9_]*\\s*\\()", "beginCaptures": { "1": { "name": "storage.type.function.cython" } }, "end": "(\\))\\s*(?:(\\:)|(.*$\\n?))", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.cython" }, "2": { "name": "punctuation.section.function.begin.cython" }, "3": { "name": "invalid.illegal.missing-section-begin.cython" } }, "name": "meta.function.cython", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "contentName": "entity.name.function.cython", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#entity_name_function" } ] }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.parameters.begin.cython" } }, "contentName": "meta.function.parameters.cython", "end": "(?=\\)\\s*\\:)", "patterns": [ { "include": "#keyword_arguments" }, { "captures": { "1": { "name": "variable.parameter.function.cython" }, "2": { "name": "punctuation.separator.parameters.cython" } }, "match": "\\b([a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(,)|(?=[\\n\\)]))" } ] } ] }, { "begin": "^\\s*(def)\\s+(?=[A-Za-z_][A-Za-z0-9_]*)", "beginCaptures": { "1": { "name": "storage.type.function.cython" } }, "end": "(\\()|\\s*($\\n?|#.*$\\n?)", "endCaptures": { "1": { "name": "punctuation.definition.parameters.begin.cython" }, "2": { "name": "invalid.illegal.missing-parameters.cython" } }, "name": "meta.function.cython", "patterns": [ { "begin": "(?=[A-Za-z_][A-Za-z0-9_]*)", "contentName": "entity.name.function.cython", "end": "(?![A-Za-z0-9_])", "patterns": [ { "include": "#entity_name_function" } ] } ] }, { "begin": "(lambda)(?=\\s+)", "beginCaptures": { "1": { "name": "storage.type.function.inline.cython" } }, "end": "(\\:)", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.cython" }, "2": { "name": "punctuation.section.function.begin.cython" }, "3": { "name": "invalid.illegal.missing-section-begin.cython" } }, "name": "meta.function.inline.cython", "patterns": [ { "begin": "\\s+", "contentName": "meta.function.inline.parameters.cython", "end": "(?=\\:)", "patterns": [ { "include": "#keyword_arguments" }, { "captures": { "1": { "name": "variable.parameter.function.cython" }, "2": { "name": "punctuation.separator.parameters.cython" } }, "match": "\\b([a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(,)|(?=[\\n\\)\\:]))" } ] } ] }, { "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.cython" } }, "name": "meta.function.decorator.cython", "patterns": [ { "begin": "(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*\\s*\\()", "beginCaptures": { "1": { "name": "punctuation.definition.decorator.cython" } }, "contentName": "entity.name.function.decorator.cython", "end": "(?=\\s*\\()", "patterns": [ { "include": "#dotted_name" } ] }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.arguments.begin.cython" } }, "contentName": "meta.function.decorator.arguments.cython", "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.cython", "end": "(?=\\s|$\\n?|#)", "name": "meta.function.decorator.cython", "patterns": [ { "begin": "(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)", "beginCaptures": { "1": { "name": "punctuation.definition.decorator.cython" } }, "end": "(?=\\s|$\\n?|#)", "patterns": [ { "include": "#dotted_name" } ] } ] }, { "begin": "(?<=\\)|\\])\\s*(\\()", "beginCaptures": { "1": { "name": "punctuation.definition.arguments.begin.cython" } }, "contentName": "meta.function-call.arguments.cython", "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.arguments.end.cython" } }, "name": "meta.function-call.cython", "patterns": [ { "include": "#keyword_arguments" }, { "include": "$self" } ] }, { "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.cython" } }, "name": "meta.function-call.cython", "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.cython" } }, "contentName": "meta.function-call.arguments.cython", "end": "(?=\\))", "patterns": [ { "include": "#keyword_arguments" }, { "include": "$self" } ] } ] }, { "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.cython" } }, "name": "meta.item-access.cython", "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.cython" } }, "contentName": "meta.item-access.arguments.cython", "end": "(?=\\])", "patterns": [ { "include": "$self" } ] } ] }, { "begin": "(?<=\\)|\\])\\s*(\\[)", "beginCaptures": { "1": { "name": "punctuation.definition.arguments.begin.cython" } }, "contentName": "meta.item-access.arguments.cython", "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.arguments.end.cython" } }, "name": "meta.item-access.cython", "patterns": [ { "include": "$self" } ] }, { "captures": { "1": { "name": "storage.type.function.cython" } }, "match": "\\b(def|lambda)\\b" }, { "captures": { "1": { "name": "storage.type.class.cython" } }, "match": "\\b(class)\\b" }, { "include": "#line_continuation" }, { "include": "#language_variables" }, { "match": "\\b(None|True|False|Ellipsis|NotImplemented|NULL)\\b", "name": "constant.language.cython" }, { "include": "#string_quoted_single" }, { "include": "#string_quoted_double" }, { "include": "#dotted_name" }, { "begin": "(\\()", "end": "(\\))", "patterns": [ { "include": "$self" } ] }, { "captures": { "1": { "name": "punctuation.definition.list.begin.cython" }, "2": { "name": "meta.empty-list.cython" }, "3": { "name": "punctuation.definition.list.end.cython" } }, "match": "(\\[)(\\s*(\\]))\\b" }, { "begin": "(\\[)", "beginCaptures": { "1": { "name": "punctuation.definition.list.begin.cython" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.list.end.cython" } }, "name": "meta.structure.list.cython", "patterns": [ { "begin": "(?<=\\[|\\,)\\s*(?![\\],])", "contentName": "meta.structure.list.item.cython", "end": "\\s*(?:(,)|(?=\\]))", "endCaptures": { "1": { "name": "punctuation.separator.list.cython" } }, "patterns": [ { "include": "$self" } ] } ] }, { "captures": { "1": { "name": "punctuation.definition.tuple.begin.cython" }, "2": { "name": "meta.empty-tuple.cython" }, "3": { "name": "punctuation.definition.tuple.end.cython" } }, "match": "(\\()(\\s*(\\)))", "name": "meta.structure.tuple.cython" }, { "captures": { "1": { "name": "punctuation.definition.dictionary.begin.cython" }, "2": { "name": "meta.empty-dictionary.cython" }, "3": { "name": "punctuation.definition.dictionary.end.cython" } }, "match": "(\\{)(\\s*(\\}))", "name": "meta.structure.dictionary.cython" }, { "begin": "(\\{)", "beginCaptures": { "1": { "name": "punctuation.definition.dictionary.begin.cython" } }, "end": "(\\})", "endCaptures": { "1": { "name": "punctuation.definition.dictionary.end.cython" } }, "name": "meta.structure.dictionary.cython", "patterns": [ { "begin": "(?<=\\{|\\,|^)\\s*(?![\\},])", "contentName": "meta.structure.dictionary.key.cython", "end": "\\s*(?:(?=\\})|(\\:))", "endCaptures": { "1": { "name": "punctuation.separator.valuepair.dictionary.cython" } }, "patterns": [ { "include": "$self" } ] }, { "begin": "(?<=\\:|^)\\s*", "contentName": "meta.structure.dictionary.value.cython", "end": "\\s*(?:(?=\\})|(,))", "endCaptures": { "1": { "name": "punctuation.separator.dictionary.cython" } }, "patterns": [ { "include": "$self" } ] } ] } ], "repository": { "builtin_exceptions": { "match": "(?x)\\b((Arithmetic|Assertion|Attribute|EOF|Environment|FloatingPoint|IO|Import|Indentation|Index|Key|Lookup|Memory|Name|OS|Overflow|NotImplemented|Reference|Runtime|Standard|Syntax|System|Tab|Type|UnboundLocal|Unicode(Translate|Encode|Decode)?|Value|ZeroDivision)Error|(Deprecation|Future|Overflow|PendingDeprecation|Runtime|Syntax|User)?Warning|KeyboardInterrupt|NotImplemented|StopIteration|SystemExit|(Base)?Exception)\\b", "name": "support.type.exception.cython" }, "builtin_functions": { "match": "(?x)\\b(\n __import__|all|abs|any|apply|callable|chr|cmp|coerce|compile|delattr|dir|\n divmod|eval|execfile|filter|getattr|globals|hasattr|hash|hex|id|\n input|intern|isinstance|issubclass|iter|len|locals|map|max|min|oct|\n ord|pow|range|raw_input|reduce|reload|repr|round|setattr|sorted|\n sum|unichr|vars|zip\n\t\t\t)\\b", "name": "support.function.builtin.cython" }, "builtin_types": { "match": "(?x)\\b(\n\t\t\t\tbasestring|bool|buffer|classmethod|complex|dict|enumerate|file|\n\t\t\t\tfloat|frozenset|int|list|long|object|open|reversed|set|\n\t\t\t\tslice|staticmethod|str|super|tuple|type|unicode|xrange\n\t\t\t)\\b", "name": "support.type.cython" }, "constant_placeholder": { "match": "(?i:%(\\([a-z_]+\\))?#?0?\\-?[ ]?\\+?([0-9]*|\\*)(\\.([0-9]*|\\*))?[hL]?[a-z%])", "name": "constant.other.placeholder.cython" }, "docstrings": { "patterns": [ { "begin": "^\\s*(?=[uU]?[rR]?\"\"\")", "end": "(?<=\"\"\")", "name": "comment.block.cython", "patterns": [ { "include": "#string_quoted_double" } ] }, { "begin": "^\\s*(?=[uU]?[rR]?''')", "end": "(?<=''')", "name": "comment.block.cython", "patterns": [ { "include": "#string_quoted_single" } ] } ] }, "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": "(?