Something went wrong. Try again.
Fork of micro-editor/micro
Something went wrong. Try again.
2.0 kB · 137 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138; Identifier naming conventions
(identifier) @variable
((identifier) @constructor (#match? @constructor "^[A-Z]"))
((identifier) @constant (#match? @constant "^[A-Z][A-Z_]*$"))
; Function calls
(decorator) @function(decorator (identifier) @function)
(call function: (attribute attribute: (identifier) @function.method))(call function: (identifier) @function)
; Builtin functions
((call function: (identifier) @function.builtin) (#match? @function.builtin "^(abs|all|any|ascii|bin|bool|breakpoint|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|__import__)$"))
; Function definitions
(function_definition name: (identifier) @function)
(attribute attribute: (identifier) @property)(type (identifier) @type)
; Literals
[ (none) (true) (false)] @constant.builtin
[ (integer) (float)] @number
(comment) @comment(string) @string(escape_sequence) @escape
(interpolation "{" @punctuation.special "}" @punctuation.special) @embedded
[ "-" "-=" "!=" "*" "**" "**=" "*=" "/" "//" "//=" "/=" "&" "&=" "%" "%=" "^" "^=" "+" "->" "+=" "<" "<<" "<<=" "<=" "<>" "=" ":=" "==" ">" ">=" ">>" ">>=" "|" "|=" "~" "@=" "and" "in" "is" "not" "or" "is not" "not in"] @operator
[ "as" "assert" "async" "await" "break" "class" "continue" "def" "del" "elif" "else" "except" "exec" "finally" "for" "from" "global" "if" "import" "lambda" "nonlocal" "pass" "print" "raise" "return" "try" "while" "with" "yield" "match" "case"] @keyword