on master help sign in
Update gleam grammar and queries (#9003)
commitc3cb1795bfd2bfe1c01badd71ac101b0c8fdd379 authorFrederick Schwalbe <88447041+fschwalbe@users.noreply.github.com> dateTue 5 Dec 2023, 14:54 (3 years ago) parent4c2bd49
2 files changed+17−6
languages.toml+1−1 runtime/queries/gleam/highlights.scm+16−5
languages.toml+1−1
@@ -1624,7 +1624,7 @@ auto-format = true
16241624
16251625[[grammar]]
16261626name = "gleam"
1627−source = { git = "https://github.com/gleam-lang/tree-sitter-gleam", rev = "a59aadf3d7c11702cad244e7cd6b67b34ca9c16a" }
1627+source = { git = "https://github.com/gleam-lang/tree-sitter-gleam", rev = "b2afa4fd6bb41a7bf912b034c653c90af7ae5122" }
16281628
16291629[[language]]
16301630name = "ron"
runtime/queries/gleam/highlights.scm+16−5
@@ -21,6 +21,8 @@
2121
2222; Functions
2323(unqualified_import (identifier) @function)
24+(unqualified_import "type" (type_identifier) @type)
25+(unqualified_import (type_identifier) @constructor)
2426(function
2527 name: (identifier) @function)
2628(external_function
@@ -43,6 +45,13 @@
4345(tuple_access
4446 index: (integer) @variable.other.member)
4547
48+; Attributes
49+(attribute
50+ "@" @attribute
51+ name: (identifier) @attribute)
52+
53+(attribute_value (identifier) @constant)
54+
4655; Type names
4756(remote_type_identifier) @type
4857(type_identifier) @type
@@ -60,10 +69,6 @@
6069(identifier) @variable
6170(discard) @comment.unused
6271
63−; Operators
64−(binary_expression
65− operator: _ @operator)
66−
6772; Keywords
6873[
6974 (visibility_modifier) ; "pub"
@@ -72,6 +77,7 @@
7277 "assert"
7378 "case"
7479 "const"
80+ ; DEPRECATED: 'external' was removed in v0.30.
7581 "external"
7682 "fn"
7783 "if"
@@ -79,11 +85,16 @@
7985 "let"
8086 "panic"
8187 "todo"
82− "try"
8388 "type"
8489 "use"
8590] @keyword
8691
92+; Operators
93+(binary_expression
94+ operator: _ @operator)
95+(boolean_negation "!" @operator)
96+(integer_negation "-" @operator)
97+
8798; Punctuation
8899[
89100 "("