Skip to content

Commit c831557

Browse files
chore: README
1 parent e53c9ec commit c831557

File tree

3 files changed

+13
-29
lines changed

3 files changed

+13
-29
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88

99
---
1010

11+
#### Usage
12+
13+
```rust
14+
use php_parser_rs::*;
15+
16+
let mut lexer = Lexer::new(None);
17+
let tokens = lexer.tokenize(&source_code[..]).unwrap();
18+
19+
let mut parser = Parser::new(None);
20+
let ast = parser.parse(tokens).unwrap();
21+
```
22+
1123
#### Contributing
1224

1325
All contributions to this repository are welcome. It's the perfect project for Rust beginners since we don't use many of Rust's complex features and the core concepts in the parser are purposely simple.

src/README.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use trunk_parser::{Lexer, Parser};
1+
use php_parser_rs::{Lexer, Parser};
22

33
fn main() {
44
let file = std::env::args().nth(1).unwrap();

0 commit comments

Comments
 (0)