mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 18:44:07 +02:00
better array key errors
This commit is contained in:
parent
189a19d631
commit
81866da439
4 changed files with 54 additions and 19 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use miette::DiagnosticResult;
|
||||
use php_literal_parser::{from_str, ParseError};
|
||||
use php_literal_parser::from_str;
|
||||
use serde_derive::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize, PartialEq)]
|
||||
|
|
@ -9,7 +9,7 @@ struct Target {
|
|||
}
|
||||
|
||||
fn main() -> DiagnosticResult<()> {
|
||||
let target = from_str(r#"["foo" => true, "bars" => [1, 2, 3, 4,]]"#)?;
|
||||
let target = from_str(r#"["foo" => true, "bars" => [1, 2, 3, 4]]"#)?;
|
||||
|
||||
assert_eq!(
|
||||
Target {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue