22 releases

new 0.23.11 Nov 20, 2024
0.23.5 Oct 15, 2024
0.22.8 Jul 26, 2024
0.22.2 Feb 25, 2024
0.20.0 Nov 18, 2023

#524 in Text editors

Download history 1718/week @ 2024-07-31 2994/week @ 2024-08-07 1577/week @ 2024-08-14 1485/week @ 2024-08-21 1552/week @ 2024-08-28 1465/week @ 2024-09-04 1457/week @ 2024-09-11 1527/week @ 2024-09-18 1578/week @ 2024-09-25 1432/week @ 2024-10-02 1301/week @ 2024-10-09 1473/week @ 2024-10-16 1175/week @ 2024-10-23 1376/week @ 2024-10-30 1612/week @ 2024-11-06 1288/week @ 2024-11-13

5,673 downloads per month
Used in 10 crates (7 directly)

MIT license

11MB
303K SLoC

C 301K SLoC JavaScript 1.5K SLoC // 0.0% comments Scheme 191 SLoC // 0.0% comments Rust 53 SLoC

tree-sitter-php

CI discord matrix crates npm pypi

PHP grammar for tree-sitter.


lib.rs:

This crate provides PHP language support for the tree-sitter parsing library.

Typically, you will use the [LANGUAGE_PHP][] constant to add this language to a tree-sitter Parser, and then use the parser to parse some code:

use tree_sitter::Parser;

let code = r#"
<?php
  echo "Hello, World!";
?>
"#;
let mut parser = Parser::new();
let language = tree_sitter_php::LANGUAGE_PHP;
parser
    .set_language(&language.into())
    .expect("Error loading PHP parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies