Closed lf- closed 1 year ago
I'm not able to replicate this. Is this still an issue?
(source_file [0, 0] - [0, 50]
(single_line_statement [0, 0] - [0, 50]
(binary_expression [0, 0] - [0, 31]
variable: (hash_access_variable [0, 0] - [0, 22]
hash_variable: (method_invocation [0, 0] - [0, 9]
object: (scalar_variable [0, 0] - [0, 2])
(arrow_operator [0, 2] - [0, 4])
function_name: (identifier [0, 4] - [0, 9]))
key: (bareword [0, 12] - [0, 21]))
variable: (scalar_variable [0, 25] - [0, 31]))
(if_simple_statement [0, 32] - [0, 50]
condition: (call_expression [0, 35] - [0, 49]
function_name: (identifier [0, 35] - [0, 42])
args: (argument [0, 43] - [0, 49]
(scalar_variable [0, 43] - [0, 49])))
(semi_colon [0, 49] - [0, 50]))))
Oh, I see what's going on. The grammar emits an AST with the ->{
node as an anonymous node and the query doesn't consider it punctuation.bracket. It's a bug in the query, not in the parser, I think. Although the query's hands might be tied, in that it might be unable to split off the bracket there to turn it into a @punctuation.bracket
.
There's some funny highlighting going on with the following snippet:
Note that the second brace is highlighted a different colour than the first.
Here is the AST from TSPlayground:
Code from: https://github.com/NixOS/hydra/blob/bab671124df0bc43a521d708bf86eece908d33af/src/lib/Hydra/Controller/Build.pm#L103-L108
Version: bbf86084d9b7eb4768f3fb9fe094b3e0600057b1