Skip to content

Commit fe263b8

Browse files
committed
Rename package from "php-parser-rs" to "php-parser" and update references throughout the codebase
1 parent b0a8781 commit fe263b8

File tree

71 files changed

+189
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+189
-189
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "php-parser-rs"
2+
name = "php-parser"
33
version = "0.1.0"
44
edition = "2024"
55

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add this to your `Cargo.toml`:
1515

1616
```toml
1717
[dependencies]
18-
php-parser-rs = { git = "https://github.com/wudi/php-parser-rs" }
18+
php-parser = { git = "https://github.com/wudi/php-parser" }
1919
bumpalo = "3.19.0"
2020
```
2121

@@ -25,8 +25,8 @@ Here is a basic example of how to parse a PHP script:
2525

2626
```rust
2727
use bumpalo::Bump;
28-
use php_parser_rs::lexer::Lexer;
29-
use php_parser_rs::parser::Parser;
28+
use php_parser::lexer::Lexer;
29+
use php_parser::parser::Parser;
3030

3131
fn main() {
3232
// The source code to parse (as bytes)
@@ -56,7 +56,7 @@ fn main() {
5656
test file `run-tests.php` from [php-src](https://github.com/php/php-src/blob/801e587faa0efd2fba633413681c68c83d6f2188/run-tests.php) with 140KB size, here are the benchmark results:
5757

5858
```bash
59-
➜ php-parser-rs git:(master) ✗ ./target/release/bench_file run-tests.php
59+
➜ php-parser git:(master) ✗ ./target/release/bench_file run-tests.php
6060
Benchmarking: run-tests.php
6161
File size: 139.63 KB
6262
Warming up...

src/bin/bench_file.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bumpalo::Bump;
2-
use php_parser_rs::lexer::Lexer;
3-
use php_parser_rs::parser::Parser;
2+
use php_parser::lexer::Lexer;
3+
use php_parser::parser::Parser;
44
use pprof::protos::Message;
55
use std::env;
66
use std::fs;

src/bin/compare.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bumpalo::Bump;
2-
use php_parser_rs::lexer::Lexer;
3-
use php_parser_rs::parser::Parser;
2+
use php_parser::lexer::Lexer;
3+
use php_parser::parser::Parser;
44
use serde_json::Value;
55
use std::env;
66
use std::fs;

src/bin/compare_corpus.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bumpalo::Bump;
2-
use php_parser_rs::lexer::Lexer;
3-
use php_parser_rs::lexer::token::TokenKind;
4-
use php_parser_rs::parser::Parser;
2+
use php_parser::lexer::Lexer;
3+
use php_parser::lexer::token::TokenKind;
4+
use php_parser::parser::Parser;
55
use rayon::prelude::*;
66
use serde_json::Value;
77
use std::env;
@@ -127,7 +127,7 @@ fn main() {
127127

128128
fn compare_tokens(
129129
p_tokens: &[Value],
130-
r_tokens: &[php_parser_rs::lexer::token::Token],
130+
r_tokens: &[php_parser::lexer::token::Token],
131131
code: &str,
132132
) -> bool {
133133
let mut p_idx = 0;

src/bin/compare_tokens.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use php_parser_rs::lexer::Lexer;
2-
use php_parser_rs::lexer::token::TokenKind;
1+
use php_parser::lexer::Lexer;
2+
use php_parser::lexer::token::TokenKind;
33
use serde_json::Value;
44
use std::env;
55
use std::fs;

src/bin/corpus_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bumpalo::Bump;
2-
use php_parser_rs::lexer::Lexer;
3-
use php_parser_rs::parser::Parser;
2+
use php_parser::lexer::Lexer;
3+
use php_parser::parser::Parser;
44
use std::env;
55
use std::fs;
66
use std::time::Instant;

src/bin/debug_file.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bumpalo::Bump;
2-
use php_parser_rs::lexer::Lexer;
3-
use php_parser_rs::parser::Parser;
2+
use php_parser::lexer::Lexer;
3+
use php_parser::parser::Parser;
44
use std::env;
55
use std::fs;
66

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bumpalo::Bump;
2-
use php_parser_rs::lexer::Lexer;
3-
use php_parser_rs::parser::Parser;
2+
use php_parser::lexer::Lexer;
3+
use php_parser::parser::Parser;
44

55
fn main() {
66
let source = b"<?php
@@ -19,7 +19,7 @@ fn main() {
1919
let mut parser = Parser::new(lexer, &arena);
2020

2121
let program = parser.parse_program();
22-
php_parser_rs::span::with_session_globals(source, || {
22+
php_parser::span::with_session_globals(source, || {
2323
println!("{:#?}", program);
2424
});
2525
}

0 commit comments

Comments
 (0)