-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Same issue as tree-sitter/java-tree-sitter#114
import tree_sitter as ts
import tree_sitter_go as tsgo
query = """
((comment)+ @injection.content
.
(import_declaration
(import_spec path: (interpreted_string_literal) @_import_c))
(#eq? @_import_c "\"C\"")
(#match? @injection.content "^//"))
"""
code = b"""
// #include <stdio.h>
// #include <errno.h>
import "C"
"""
lang = ts.Language(tsgo.language())
parser = ts.Parser(lang)
tree = parser.parse(code)
query = ts.Query(lang, query)
cursor = ts.QueryCursor(query)
print(cursor.captures(tree.root_node))
query = ts.Query(lang, query)
tree_sitter.QueryError: Invalid predicate in pattern at row 1: #eq? expects 2 arguments, got 4
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed