mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 18:44:07 +02:00
crate doc
This commit is contained in:
parent
36aada0b44
commit
64653f3cd5
1 changed files with 20 additions and 0 deletions
20
src/lib.rs
20
src/lib.rs
|
|
@ -1,3 +1,23 @@
|
||||||
|
//! Parser for php literals.
|
||||||
|
//!
|
||||||
|
//! Allows parsing of php string, bool, number and array literals.
|
||||||
|
//!
|
||||||
|
//! ## Example
|
||||||
|
//!
|
||||||
|
//! ```rust
|
||||||
|
//! use php_literal_parser::{parse, Value, Key};
|
||||||
|
//! # use std::fmt::Debug;
|
||||||
|
//! # 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(())
|
||||||
|
//! # }
|
||||||
|
//! ```
|
||||||
|
//!
|
||||||
mod ast;
|
mod ast;
|
||||||
mod error;
|
mod error;
|
||||||
mod lexer;
|
mod lexer;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue