json-pawarser: make return of object grammar easier to understand

This commit is contained in:
Schrottkatze 2024-10-29 19:40:50 +01:00
parent fcf91f25e3
commit 662cb8ba0e
No known key found for this signature in database

View file

@ -23,10 +23,10 @@ pub(super) fn object(p: &mut Parser) -> Option<CompletedMarker> {
}
}
Some(if !p.eat(SyntaxKind::BRACE_CLOSE) {
obj_start.error(p, SyntaxError::UnclosedObject)
} else {
Some(if p.eat(SyntaxKind::BRACE_CLOSE) {
obj_start.complete(p, SyntaxKind::OBJECT)
} else {
obj_start.error(p, SyntaxError::UnclosedObject)
})
}