16 unstable releases (3 breaking)

0.23.5 Oct 15, 2024
0.23.2 Sep 2, 2024
0.22.8 Jul 26, 2024
0.22.2 Feb 25, 2024
0.20.0 Nov 18, 2023

#2812 in Parser implementations

Download history 1633/week @ 2024-07-12 1626/week @ 2024-07-19 1933/week @ 2024-07-26 2349/week @ 2024-08-02 2268/week @ 2024-08-09 1528/week @ 2024-08-16 1566/week @ 2024-08-23 1478/week @ 2024-08-30 1502/week @ 2024-09-06 1442/week @ 2024-09-13 1684/week @ 2024-09-20 1412/week @ 2024-09-27 1410/week @ 2024-10-04 1338/week @ 2024-10-11 1434/week @ 2024-10-18 1139/week @ 2024-10-25

5,594 downloads per month
Used in 7 crates

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