New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tree-sitter-go

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sitter-go - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

3

corpus/expressions.txt

@@ -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)))))))))))))

12

grammar.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc