7 releases

0.22.4 May 4, 2024
0.22.3 May 4, 2024
0.22.2 Feb 25, 2024
0.21.1 Jan 27, 2024
0.20.0 Nov 18, 2023

#447 in Text editors

Download history 723/week @ 2024-01-24 1046/week @ 2024-01-31 1110/week @ 2024-02-07 1609/week @ 2024-02-14 3163/week @ 2024-02-21 2213/week @ 2024-02-28 2411/week @ 2024-03-06 2344/week @ 2024-03-13 2204/week @ 2024-03-20 1527/week @ 2024-03-27 1470/week @ 2024-04-03 1226/week @ 2024-04-10 1157/week @ 2024-04-17 1226/week @ 2024-04-24 1519/week @ 2024-05-01 1395/week @ 2024-05-08

5,420 downloads per month
Used in 2 crates

MIT license

10MB
279K SLoC

C 277K SLoC JavaScript 1.5K SLoC // 0.0% comments Scheme 163 SLoC // 0.0% comments Rust 50 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 function 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();
parser
    .set_language(&tree_sitter_php::language_php())
    .expect("Error loading PHP grammar");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies

~2.8–4MB
~72K SLoC