tree-sitter-go
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -173,2 +173,3 @@ ============================================ | ||
([]a.b)(c.d) | ||
<-chan int(c) | ||
// These type conversions cannot be distinguished from call expressions | ||
@@ -192,2 +193,4 @@ T(x) | ||
(selector_expression (identifier) (field_identifier))) | ||
(type_conversion_expression | ||
(channel_type (type_identifier)) (identifier)) | ||
(comment) | ||
@@ -194,0 +197,0 @@ (call_expression |
@@ -553,1 +553,37 @@ ============================================ | ||
(empty_statement)))) | ||
============================================= | ||
Nested control statements | ||
============================================= | ||
package main | ||
func main() { | ||
for i, v := range vectors { | ||
func() { | ||
if v == v { | ||
fmt.Println("something: %v", vectors[i]) | ||
} | ||
}() | ||
} | ||
} | ||
--- | ||
(source_file | ||
(package_clause (package_identifier)) | ||
(function_declaration (identifier) (parameters) (block | ||
(for_statement | ||
(range_clause (expression_list (identifier) (identifier)) (identifier)) | ||
(block | ||
(call_expression | ||
(func_literal | ||
(parameters) | ||
(block | ||
(if_statement | ||
(binary_expression (identifier) (identifier)) | ||
(block | ||
(call_expression | ||
(selector_expression (identifier) (field_identifier)) | ||
(interpreted_string_literal) | ||
(index_expression (identifier) (identifier))))))))))))) |
@@ -9,3 +9,4 @@ const | ||
and: 2, | ||
or: 1 | ||
or: 1, | ||
composite_literal: -1, | ||
}, | ||
@@ -72,3 +73,2 @@ | ||
[$._parameter_list, $._simple_type], | ||
[$.composite_literal, $._expression], | ||
], | ||
@@ -323,5 +323,5 @@ | ||
channel_type: $ => choice( | ||
prec(5, seq('chan', $._type)), | ||
seq('chan', $._type), | ||
seq('chan', '<-', $._type), | ||
seq('<-', 'chan', $._type) | ||
prec(PREC.unary, seq('<-', 'chan', $._type)) | ||
), | ||
@@ -624,3 +624,3 @@ | ||
composite_literal: $ => seq( | ||
composite_literal: $ => prec(PREC.composite_literal, seq( | ||
choice( | ||
@@ -636,3 +636,3 @@ $.map_type, | ||
$.literal_value | ||
), | ||
)), | ||
@@ -639,0 +639,0 @@ literal_value: $ => seq( |
{ | ||
"name": "tree-sitter-go", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Go grammar for tree-sitter", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2265354