Closed asutoshpalai closed 4 months ago
I am seeing SIGSEGV crash while running the following code, which runs a query over the code and tries to print the captures.
SIGSEGV
import tree_sitter from tree_sitter_languages import get_language code = """ ;; Define a structure (defstruct person name age) """ chunk_query = """ [ (list_lit (defun)) @defun (list_lit (sym_lit) @struct.keyword (#eq? @struct.keyword "defstruct")) @defstruct (list_lit (sym_lit) @class.keyword (#eq? @class.keyword "defclass")) @defclass ] """ language = get_language("commonlisp") parser = tree_sitter.Parser() parser.set_language(language) tree = parser.parse(bytes(code, encoding="UTF-8")) query = language.query(chunk_query) for node, name in query.captures(tree.root_node): print(name) print(node.text)
$ python test.py defstruct b'(defstruct person\n name\n age)' struct.keyword Segmentation fault (core dumped)
I am seeing
SIGSEGV
crash while running the following code, which runs a query over the code and tries to print the captures.