22 releases

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

#527 in Text editors

Download history 1533/week @ 2024-08-22 1489/week @ 2024-08-29 1498/week @ 2024-09-05 1496/week @ 2024-09-12 1574/week @ 2024-09-19 1426/week @ 2024-09-26 1472/week @ 2024-10-03 1279/week @ 2024-10-10 1468/week @ 2024-10-17 1213/week @ 2024-10-24 1376/week @ 2024-10-31 1664/week @ 2024-11-07 1863/week @ 2024-11-14 1527/week @ 2024-11-21 1790/week @ 2024-11-28 1562/week @ 2024-12-05

7,038 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