update Gleam grammar and queries
With respect to the queries:
The locals scope for functions was not large enough, so a function's
parameter could outlive the function body. To fix it, we just widen
the scope to the `function` node.
See also https://github.com/gleam-lang/tree-sitter-gleam/issues/25
With respect to the parser:
An external scanner has been added that fixes the parsing of strings.
Previously, a comment inside a string would act like a comment rather
than string contents.
See also https://github.com/gleam-lang/tree-sitter-gleam/issues/14#issuecomment-1129263640
A new constructor node has been added as well which makes type
highlighting more fine grained.
See also https://github.com/gleam-lang/tree-sitter-gleam/pull/29
commit45dd54082e4dde74b7d344c6bb8a4ff2a09e627e
authorMichael Davis <mcarsondavis@gmail.com>
dateTue 17 May 2022, 14:31 (4 years ago)
parent10463fe
languages.toml+1−1
@@ -1127,7 +1127,7 @@ indent = { tab-width = 2, unit = " " }
11271127
11281128[[grammar]]
11291129name = "gleam"
1130−source = { git = "https://github.com/gleam-lang/tree-sitter-gleam", rev = "7159ce961592192b0e7cdf88782cda0fdf41a4cb" }
1130+source = { git = "https://github.com/gleam-lang/tree-sitter-gleam", rev = "d7861b2a4b4d594c58bb4f1be5f1f4ee4c67e5c3" }
11311131
11321132[[language]]
11331133name = "ron"
runtime/queries/gleam/highlights.scm+5
@@ -12,6 +12,8 @@
1212(import alias: (identifier) @namespace)
1313(remote_type_identifier
1414 module: (identifier) @namespace)
15+(remote_constructor_name
16+ module: (identifier) @namespace)
1517((field_access
1618 record: (identifier) @namespace
1719 field: (label) @function)
@@ -45,6 +47,9 @@
4547(remote_type_identifier) @type
4648(type_identifier) @type
4749
50+; Data constructors
51+(constructor_name) @constructor
52+
4853; Literals
4954(string) @string
5055(bit_string_segment_option) @function.builtin
runtime/queries/gleam/locals.scm+1−1
@@ -1,5 +1,5 @@
11; Scopes
2−(function_body) @local.scope
2+(function) @local.scope
33
44(case_clause) @local.scope
55