mirror of
https://gitee.com/openharmony/third_party_rust_nom
synced 2024-11-27 01:30:32 +00:00
proper end of file parsing
This commit is contained in:
parent
51545eb4b0
commit
2cfa50008c
@ -11,7 +11,7 @@ use nom::{
|
||||
branch::alt,
|
||||
bytes::complete::{escaped, tag, take_while},
|
||||
character::complete::{alphanumeric1 as alphanumeric, char, one_of},
|
||||
combinator::{complete, map, not, cut},
|
||||
combinator::{map, opt, cut},
|
||||
error::{context, ErrorKind, ParseError},
|
||||
error::{VerboseError, VerboseErrorKind},
|
||||
multi::separated_list,
|
||||
@ -102,7 +102,7 @@ fn root<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&'a str, JsonValue, E
|
||||
delimited(
|
||||
sp,
|
||||
alt((map(hash, JsonValue::Object), map(array, JsonValue::Array))),
|
||||
not(complete(sp)),
|
||||
opt(sp),
|
||||
)(i)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user