{"id":38137730,"url":"https://github.com/v-analyzer/v-tree-sitter","last_synced_at":"2026-01-16T22:43:08.125Z","repository":{"id":172452924,"uuid":"643865313","full_name":"v-analyzer/v-tree-sitter","owner":"v-analyzer","description":"V bindings for tree-sitter","archived":false,"fork":false,"pushed_at":"2023-12-11T09:33:34.000Z","size":716,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T08:49:57.401Z","etag":null,"topics":["binding","tree","tree-sitter","vlang","vlang-bindings","vosca"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/v-analyzer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-05-22T10:13:55.000Z","updated_at":"2024-04-25T17:35:32.000Z","dependencies_parsed_at":"2023-12-22T14:00:39.191Z","dependency_job_id":"2ccae5f2-f16b-4ae6-8957-0f32dc478679","html_url":"https://github.com/v-analyzer/v-tree-sitter","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":"0.27586206896551724","last_synced_commit":"9df8229b1030947329abdcb88eb7e9782913d8d3"},"previous_names":["spavn-analyzer/v-tree-sitter","v-analyzer/v-tree-sitter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/v-analyzer/v-tree-sitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v-analyzer%2Fv-tree-sitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v-analyzer%2Fv-tree-sitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v-analyzer%2Fv-tree-sitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v-analyzer%2Fv-tree-sitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v-analyzer","download_url":"https://codeload.github.com/v-analyzer/v-tree-sitter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v-analyzer%2Fv-tree-sitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28485755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binding","tree","tree-sitter","vlang","vlang-bindings","vosca"],"created_at":"2026-01-16T22:43:08.026Z","updated_at":"2026-01-16T22:43:08.102Z","avatar_url":"https://github.com/v-analyzer.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# V tree-sitter\n\n[![Test](https://github.com/spavn-analyzer/v-tree-sitter/actions/workflows/test_tree_sitter.yml/badge.svg)](https://github.com/spavn-analyzer/v-tree-sitter/actions/workflows/test_tree_sitter.yml)\n\nV bindings for the\n[tree-sitter](https://github.com/tree-sitter/tree-sitter)\nparsing library.\n\n## Installation\n\n```sh\nv install https://github.com/spavn-analyzer/v-tree-sitter\n```\n\n## Basic Usage\n\nCreate a parser with a grammar:\n\n```v\nimport v_tree_sitter.tree_sitter\nimport v_tree_sitter.languages.tree_sitter_v as v\n\nmut p := tree_sitter.new_parser[v.NodeType](v.type_factory)\np.set_language(v.language)\n```\n\nParse some code:\n\n```v\ncode := 'fn main() {}'\ntree := p.parse_string(source: code)\n```\n\nInspect the syntax tree:\n\n```v skip\nroot := tree.root_node()\n\n// (source_file (function_declaration name: (identifier) signature: \n// (signature parameters: (parameter_list)) body: (block)))\nprintln(root)\n\nfc := root.first_child()?\n\nif fc.type_name == .function_declaration {\n    if name_node := fc.child_by_field_name('name') {\n        println('Found function: ${name_node.text(rope)}') // Found function: main\n        println('Position: ${name_node.range()}')\n        println('Line: ${name_node.start_point().row}') // Line: 0\n    }\n}\n```\n\n## Use old tree\n\n```v\ncode := 'fn main() {}'\ntree := p.parse_string(source: code, tree: old_tree.raw_tree)\n```\n\n## Examples\n\nSee examples in the `examples` directory.\n\n## Project structure\n\n- `examples` — examples of using the library\n- `languages` — languages sources (only V for now)\n- `lib` — tree-sitter C lib sources\n- `tests` — tests for the bindings\n- `tree_sitter` — bindings sources\n\n## Updating tree-sitter\n\nTo update the tree-sitter lib, run:\n\n```sh\nv update_tree_sitter.vsh\n```\n\n## Authors\n\nThis project initially started by\n[nedpals](https://github.com/nedpals)\nand after that in 2023 it was heavily modified by the\n[VOSCA](https://github.com/vlang-association).\n\n## License\n\nThis project is under the **MIT License**.\nSee the\n[LICENSE](https://github.com/vlang-association/spavn-analyzer/blob/master/tree_sitter/LICENSE)\nfile for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv-analyzer%2Fv-tree-sitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv-analyzer%2Fv-tree-sitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv-analyzer%2Fv-tree-sitter/lists"}