better array key errors

This commit is contained in:
Robin Appelman 2021-08-29 21:06:52 +02:00
commit 81866da439
4 changed files with 54 additions and 19 deletions

View file

@ -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 {