Update Hare grammar (#11130)
This change uses <https://git.sr.ht/~ecs/tree-sitter-hare/> that is up-to-date and linked from the official documentation.
This commit is contained in:
parent
b0f3fe7556
commit
ec0bdb3976
3 changed files with 24 additions and 44 deletions
|
@ -2055,7 +2055,7 @@ indent = { tab-width = 8, unit = "\t" }
|
||||||
|
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "hare"
|
name = "hare"
|
||||||
source = { git = "https://git.sr.ht/~ecmma/tree-sitter-hare", rev = "2495958aaf3f93581c87ec020164255e80655331" }
|
source = { git = "https://git.sr.ht/~ecs/tree-sitter-hare", rev = "07035a248943575444aa0b893ffe306e1444c0ab" }
|
||||||
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "devicetree"
|
name = "devicetree"
|
||||||
|
|
|
@ -1,22 +1,5 @@
|
||||||
[
|
(type) @type
|
||||||
"f32"
|
(type "const" @type)
|
||||||
"f64"
|
|
||||||
"i16"
|
|
||||||
"i32"
|
|
||||||
"i64"
|
|
||||||
"i8"
|
|
||||||
"int"
|
|
||||||
"rune"
|
|
||||||
"str"
|
|
||||||
"u16"
|
|
||||||
"u32"
|
|
||||||
"u64"
|
|
||||||
"u8"
|
|
||||||
"uint"
|
|
||||||
"uintptr"
|
|
||||||
"void"
|
|
||||||
] @type
|
|
||||||
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"else"
|
"else"
|
||||||
|
@ -36,28 +19,23 @@
|
||||||
"break"
|
"break"
|
||||||
] @keyword.control.repeat
|
] @keyword.control.repeat
|
||||||
|
|
||||||
[
|
"return" @keyword.control.return
|
||||||
"return"
|
|
||||||
"yield"
|
|
||||||
] @keyword.control.return
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"abort"
|
"abort"
|
||||||
"assert"
|
"assert"
|
||||||
] @keyword.control.exception
|
] @keyword.control.exception
|
||||||
|
|
||||||
[
|
"fn" @keyword.function
|
||||||
"def"
|
|
||||||
"fn"
|
|
||||||
] @keyword.function
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"alloc"
|
"alloc"
|
||||||
"append"
|
"append"
|
||||||
"as"
|
"as"
|
||||||
"bool"
|
"bool"
|
||||||
"char"
|
"case"
|
||||||
"const"
|
"const"
|
||||||
|
"def"
|
||||||
"defer"
|
"defer"
|
||||||
"delete"
|
"delete"
|
||||||
"enum"
|
"enum"
|
||||||
|
@ -68,13 +46,14 @@
|
||||||
"match"
|
"match"
|
||||||
"nullable"
|
"nullable"
|
||||||
"offset"
|
"offset"
|
||||||
"size"
|
|
||||||
"static"
|
|
||||||
"struct"
|
"struct"
|
||||||
"type"
|
"type"
|
||||||
"union"
|
"union"
|
||||||
|
"yield"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
|
"static" @keyword.storage.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"."
|
"."
|
||||||
"!"
|
"!"
|
||||||
|
@ -137,15 +116,17 @@
|
||||||
"null"
|
"null"
|
||||||
"true"
|
"true"
|
||||||
] @constant.builtin
|
] @constant.builtin
|
||||||
|
(literal "void") @constant.builtin
|
||||||
|
|
||||||
(string_constant) @string
|
(string_literal) @string
|
||||||
(escape_sequence) @constant.character.escape
|
(escape_sequence) @constant.character.escape
|
||||||
(rune_constant) @string
|
(rune_literal) @string
|
||||||
(integer_constant) @constant.numeric.integer
|
(integer_literal) @constant.numeric.integer
|
||||||
(floating_constant) @constant.numeric.float
|
(floating_literal) @constant.numeric.float
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
(postfix_expression) @function)
|
(postfix_expression) @function)
|
||||||
|
(size_expression "size" @function.builtin)
|
||||||
|
|
||||||
(function_declaration
|
(function_declaration
|
||||||
name: (identifier) @function)
|
name: (identifier) @function)
|
||||||
|
@ -158,4 +139,4 @@
|
||||||
(fndec_attrs) @special
|
(fndec_attrs) @special
|
||||||
|
|
||||||
(identifier) @variable
|
(identifier) @variable
|
||||||
|
(struct_union_field (name)) @variable
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
(unit) @local.scope
|
(sub_unit) @local.scope
|
||||||
|
|
||||||
(function_declaration) @local.scope
|
(function_declaration) @local.scope
|
||||||
|
(compound_expression) @local.scope
|
||||||
|
|
||||||
(global_binding
|
(global_binding
|
||||||
(identifier) @local.definition)
|
(identifier) @local.definition)
|
||||||
(constant_binding
|
(constant_binding
|
||||||
(identifier) @local.definition)
|
(identifier) @local.definition)
|
||||||
(type_bindings
|
(type_binding
|
||||||
(identifier) @local.definition)
|
(identifier) @local.definition)
|
||||||
|
|
||||||
(function_declaration
|
(function_declaration
|
||||||
(prototype
|
(identifier) @local.definition)
|
||||||
(parameter_list
|
(function_declaration
|
||||||
(parameters
|
(parameter (name) @local.definition))
|
||||||
(parameter
|
|
||||||
(name) @local.definition)))))
|
|
||||||
|
|
||||||
(identifier) @local.reference
|
(identifier) @local.reference
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue