mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 18:44:07 +02:00
basic readme, cleanup token error
This commit is contained in:
parent
3184e19b95
commit
89610734af
2 changed files with 44 additions and 4 deletions
17
README.md
Normal file
17
README.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# php-literal-parser
|
||||
|
||||
parser for php literals.
|
||||
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use php_literal_parser::parse;
|
||||
use std::error::Error;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let map = parse(r#"["foo" => true, "nested" => ['foo' => false]]"#)?;
|
||||
assert_eq!(map["foo"], true);
|
||||
assert_eq!(map["nested"]["foo"], false);
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue