go-tree-sitter
go-tree-sitter copied to clipboard
Incorrect string parsing in Go
Steps to reproduce:
str1 := "hello world"
- Parse the sample above
- Check the nodes
Expected:
(source_file (short_var_declaration left: (expression_list (identifier)) right: (expression_list (interpreted_string_literal (interpreted_string_literal_content)))))
Actual:
(source_file (short_var_declaration left: (expression_list (identifier)) right: (expression_list (interpreted_string_literal))))
As you can see, the interpreted_string_literal_content node is missing.
github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82
Maybe it's an expected behavior, I'm not sure, but all the other languages I checked had a parent node for the string literal, and a child node for string content. It's helpful to follow a single standard in this case.