Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit b648ef5

Browse files
Update README.md
1 parent ec4cb41 commit b648ef5

File tree

1 file changed

+2
-79
lines changed

1 file changed

+2
-79
lines changed

README.md

+2-79
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,4 @@
11
# PHP-Parser
22

3-
A handwritten fault-tolerant, recursive-descent parser for PHP written in Rust.
4-
5-
[![justforfunnoreally.dev badge](https://img.shields.io/badge/justforfunnoreally-dev-9ff)](https://justforfunnoreally.dev)
6-
7-
> **Warning** - this is still alpha software and the public API is still subject to change. Please use at your own risk.
8-
9-
---
10-
11-
## Usage
12-
13-
Add `php-parser-rs` in your `Cargo.toml`'s `dependencies` section
14-
15-
```toml
16-
[dependencies]
17-
php-parser-rs = { git = "https://github.com/php-rust-tools/parser" }
18-
```
19-
20-
or use `cargo add`
21-
22-
```sh
23-
cargo add php-parser-rs --git https://github.com/php-rust-tools/parser
24-
```
25-
26-
### Example
27-
28-
```rust
29-
use std::io::Result;
30-
31-
use php_parser_rs::parser;
32-
33-
const CODE: &str = r#"<?php
34-
35-
final class User {
36-
public function __construct(
37-
public readonly string $name,
38-
public readonly string $email,
39-
public readonly string $password,
40-
) {
41-
}
42-
}
43-
"#;
44-
45-
fn main() -> Result<()> {
46-
match parser::parse(CODE) {
47-
Ok(ast) => {
48-
println!("{:#?}", ast);
49-
}
50-
Err(err) => {
51-
println!("{}", err.report(CODE, None, true, false)?);
52-
53-
println!("parsed so far: {:#?}", err.partial);
54-
}
55-
}
56-
57-
Ok(())
58-
}
59-
```
60-
61-
## License
62-
63-
Licensed under either of
64-
65-
* Apache License, Version 2.0
66-
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
67-
* MIT license
68-
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
69-
70-
at your option.
71-
72-
## Contribution
73-
74-
Unless you explicitly state otherwise, any contribution intentionally submitted
75-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
76-
dual licensed as above, without any additional terms or conditions.
77-
78-
## Credits
79-
80-
* [Ryan Chandler](https://github.com/ryangjchandler)
81-
* [All contributors](https://github.com/ryangjchandler/php-parser-rs/graphs/contributors)
3+
> [!WARNING]
4+
> This package has been archived and is **no longer maintained**. If you rely on this package for a project, please migrate the the PHP parser provided by the [PXP](https://github.com/pxp-lang/pxp) project.

0 commit comments

Comments
 (0)