-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
While this is a JSON5 feature rather than JSONC, the parser seems to implement support but fails?:
let parsed = jsonc_parser::parse_to_value(r#"{ "test": +42 }"#, &Default::default());
println!("{:#?}", parsed);Outputs error:
Err(
ParseError {
range: Range {
start: 10,
end: 11,
},
message: "Unexpected token",
display_message: "Unexpected token on line 1 column 11.",
},
)
Lines 272 to 293 in abd65a8
| match self.current_char() { | |
| Some('e') | Some('E') => { | |
| match self.move_next_char() { | |
| Some('-') | Some('+') => { | |
| self.move_next_char(); | |
| if !self.is_digit() { | |
| return Err(self.create_error_for_current_char("Expected a digit")); | |
| } | |
| } | |
| _ => { | |
| if !self.is_digit() { | |
| return Err(self.create_error_for_current_char("Expected plus, minus, or digit in number literal")); | |
| } | |
| } | |
| } | |
| while self.is_digit() { | |
| self.move_next_char(); | |
| } | |
| } | |
| _ => {} | |
| } |
Or is this observation a misunderstanding? (it was first noted here)
It does seem accurate that this crate is more of a JSON5 parser than a JSONC one?
Metadata
Metadata
Assignees
Labels
No labels