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
This commit is contained in:
Michael Davis 2022-05-17 14:31:39 -05:00 committed by Blaž Hrastnik
parent 10463fe32c
commit 45dd54082e
3 changed files with 7 additions and 2 deletions

View File

@ -1127,7 +1127,7 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "gleam"
source = { git = "https://github.com/gleam-lang/tree-sitter-gleam", rev = "7159ce961592192b0e7cdf88782cda0fdf41a4cb" }
source = { git = "https://github.com/gleam-lang/tree-sitter-gleam", rev = "d7861b2a4b4d594c58bb4f1be5f1f4ee4c67e5c3" }
[[language]]
name = "ron"

View File

@ -12,6 +12,8 @@
(import alias: (identifier) @namespace)
(remote_type_identifier
module: (identifier) @namespace)
(remote_constructor_name
module: (identifier) @namespace)
((field_access
record: (identifier) @namespace
field: (label) @function)
@ -45,6 +47,9 @@
(remote_type_identifier) @type
(type_identifier) @type
; Data constructors
(constructor_name) @constructor
; Literals
(string) @string
(bit_string_segment_option) @function.builtin

View File

@ -1,5 +1,5 @@
; Scopes
(function_body) @local.scope
(function) @local.scope
(case_clause) @local.scope