From 957ef202747d1b1871f89f9a00749c9ed565c56c Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sat, 18 Nov 2023 15:19:57 -0500 Subject: [PATCH] chore: update Cargo.toml and readme --- Cargo.lock | 19 ++++++++++++++----- Cargo.toml | 8 ++++---- bindings/rust/README.md | 41 +++++++++++++++++------------------------ 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c3964473..1d34bea2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,18 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.73" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "libc" +version = "0.2.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "memchr" @@ -42,9 +51,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "tree-sitter" -version = "0.20.6" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3b781640108d29892e8b9684642d2cda5ea05951fd58f0fea1db9edeb9b71" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" dependencies = [ "cc", "regex", @@ -52,7 +61,7 @@ dependencies = [ [[package]] name = "tree-sitter-php" -version = "0.19.1" +version = "0.20.0" dependencies = [ "cc", "tree-sitter", diff --git a/Cargo.toml b/Cargo.toml index 3938c05d..06d67841 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "tree-sitter-php" -description = "php grammar for the tree-sitter parsing library" version = "0.19.1" +description = "PHP grammar for tree-sitter" keywords = ["incremental", "parsing", "php"] categories = ["parsing", "text-editors"] repository = "https://github.com/tree-sitter/tree-sitter-php" -edition = "2018" +edition = "2021" license = "MIT" build = "bindings/rust/build.rs" @@ -15,7 +15,7 @@ include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"] path = "bindings/rust/lib.rs" [dependencies] -tree-sitter = ">= 0.20, < 0.21" +tree-sitter = "~0.20.10" [build-dependencies] -cc = "1.0" +cc = "~1.0.83" diff --git a/bindings/rust/README.md b/bindings/rust/README.md index 1d698005..d8e3cd41 100644 --- a/bindings/rust/README.md +++ b/bindings/rust/README.md @@ -1,50 +1,43 @@ -# tree-sitter-php +# tree-sitter-c -This crate provides support of the PHP language for the [tree-sitter][] parsing library. To use this crate, add it to -the `[dependencies]` section of your -`Cargo.toml` file. As this crate is not (yet) published to the central registry, you will have to specify it as a git -dependency, currently we suggest using the `master` branch. +This crate provides a PHP grammar for the [tree-sitter][] parsing library. To +use this crate, add it to the `[dependencies]` section of your `Cargo.toml` +file. (Note that you will probably also need to depend on the +[`tree-sitter`][tree-sitter crate] crate to use the parsed result in any useful +way.) -You will also need the [tree-sitter crate][] to do the actual parsing here. - -``` toml +```toml [dependencies] -tree-sitter = "0.19" -tree-sitter-php = { git = "https://github.com/tree-sitter/tree-sitter-php.git", branch = "master" } +tree-sitter = "0.20.10" +tree-sitter-php = "0.19.1" ``` -To you the parser, you need to obtain an instance of a [`tree_sitter::Language`][Language] struct for php. -The `language()` function provides this. -Passing this struct to a [`tree_sitter::Parser`][Parser] will enable it to parse PHP. +Typically, you will use the [language][language func] function to add this +grammar to a tree-sitter [Parser][], and then use the parser to parse some code: -``` rust +```rust use tree_sitter::Parser; fn main() { let code = r#"