| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- ; Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- ; Exceptions. See /LICENSE for license information.
- ; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- ; This maps syntax node patterns to highlighting scopes.
- ; The scopes are used themes and editors to select style for that node.
- (comment) @comment
- (builtin_type) @type.builtin
- (bool_literal) @constant.builtin
- (string) @string
- (numeric_literal) @constant.builtin
- (numeric_type_literal) @type.builtin
- ; function declaration or call expression => function
- (function_declaration (declared_name (ident) @function))
- (call_expression (ident) @function)
- (namespace_declaration (declared_name) @namespace)
- (interface_declaration (declared_name) @type)
- (constraint_declaration (declared_name) @type)
- (class_declaration (declared_name) @type)
- (choice_declaration (declared_name) @type)
- (binding_lhs) @variable
- ; upper case => type
- ((ident) @type
- (#match? @type "^[A-Z]"))
- ; lower case => variable
- ((ident) @variable
- (#match? @variable "^[a-z_]"))
- [
- "("
- ")"
- "{"
- "}"
- "["
- "]"
- ] @punctuation.bracket
- [
- "."
- ";"
- ","
- ":"
- ":!"
- "=>"
- ] @punctuation.delimiter
- "->" @punctuation
- [
- "+"
- "-"
- (binary_star)
- "/"
- "%"
- "=="
- "!="
- "<"
- "<="
- ">"
- ">="
- "not"
- "and"
- "or"
- "|"
- "&"
- "^"
- ">>"
- "<<"
- "*" ; prefix star
- (postfix_star)
- "++"
- "--"
- ] @operator
- ; keywords not used in grammar.js are commented out
- [
- "abstract"
- ; "adapt"
- "addr"
- "alias"
- "and"
- "api"
- "as"
- "auto"
- "base"
- "break"
- ; "Core"
- "case"
- "choice"
- "class"
- "constraint"
- "continue"
- "default"
- "destructor"
- "else"
- "extend"
- ; "final"
- "fn"
- "for"
- "forall"
- ; "friend"
- "if"
- "impl"
- "impls"
- "import"
- "in"
- "interface"
- "let"
- "library"
- ; "like"
- "match"
- "namespace"
- "not"
- ; "observe"
- "or"
- ; "override"
- "package"
- ; "partial"
- ; "private"
- ; "protected"
- "require"
- "return"
- "returned"
- "Self"
- ; "self"
- "template"
- "then"
- "type"
- "var"
- "virtual"
- "where"
- "while"
- ] @keyword
|