{"id":15144302,"url":"https://github.com/todesking/serde_tree_sitter","last_synced_at":"2026-01-18T09:01:57.097Z","repository":{"id":230604492,"uuid":"779770837","full_name":"todesking/serde_tree_sitter","owner":"todesking","description":"Serde Deserializer for tree_sitter","archived":false,"fork":false,"pushed_at":"2024-04-13T15:57:09.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-24T16:59:08.283Z","etag":null,"topics":["serde","tree-sitter"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/todesking.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-30T18:32:35.000Z","updated_at":"2024-04-12T16:41:19.000Z","dependencies_parsed_at":"2024-04-19T00:15:31.289Z","dependency_job_id":null,"html_url":"https://github.com/todesking/serde_tree_sitter","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"683e25d34341ddae36098ad730dee2284f0c6630"},"previous_names":["todesking/serde_tree_sitter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/todesking/serde_tree_sitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fserde_tree_sitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fserde_tree_sitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fserde_tree_sitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fserde_tree_sitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/todesking","download_url":"https://codeload.github.com/todesking/serde_tree_sitter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fserde_tree_sitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28500652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["serde","tree-sitter"],"created_at":"2024-09-26T10:40:22.331Z","updated_at":"2026-01-18T09:01:57.069Z","avatar_url":"https://github.com/todesking.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serde deserializer for Tree-sitter\n\nDeserializer for `tree_sitter::Node`.\nYou can map tree-sitter's parse result to Rust struct/enum with `#[derive(serde::Deserialize)]`.\n\n## Example\n\n### Map node to enum\n```javascript\n// grammar.js\nrules: {\n  expr: $ =\u003e choice($.expr_int, $.expr_bool)\n}\n```\n\n```rust\n#[derive(serde::Deserialize, Debug)]\n#[serde(rename_all = \"snake_case\")]\nenum Expr {\n    ExprInt(i64),\n    ExprBool(bool),\n}\n\nlet tree: tree_sitter::Tree = parse(\"...\")?;\n\nserde_tree_sitter::from_tree::\u003cExpr\u003e(tree, src, true)\n```\n\n### Map named children to tuple struct\n\n```javascript\n// grammar.js\nrules: {\n  let: $ =\u003e seq('let', $.ident, '=', $.expr),\n  // ...\n}\n```\n\n```rust\n#[derive(serde::Deserialize, Debug)]\n#[serde(rename=\"let\")]\nstruct Let(Ident, Expr);\n```\n\n### Map named children to vec\n\n```javascript\nrules: {\n  nums: $ =\u003e repeat(seq($.int, ',')),\n  // ...\n}\n```\n\n```rust\nserde_tree_sitter::from_tree::\u003cVec\u003cu32\u003e\u003e(tree, src, true)\n```\n\n## Map field to struct\n```javascript\nrules: {\n  object: $ =\u003e seq('{', repeat(seq($.pair, ',')), '}'),\n  pair: $ =\u003e seq(field('key', $.ident), ':', field('value', $.expr),\n  // ...\n}\n```\n\n```rust\n#[derive(serde::Deserialize, Debug)]\n#[serde(rename=\"object\")]\nstruct Object(Vec\u003cPair\u003e);\n\n#[derive(serde::Deserialize, Debug)]\n#[serde(rename=\"pair\")]\n#[serde(rename_all=\"snake_case\")]\nstruct Pair {\n    key: String,\n    value: Expr,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodesking%2Fserde_tree_sitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftodesking%2Fserde_tree_sitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodesking%2Fserde_tree_sitter/lists"}