diff --git a/crates/json-pawarser/src/grammar/object.rs b/crates/json-pawarser/src/grammar/object.rs index 8cc2933..d72dcdc 100644 --- a/crates/json-pawarser/src/grammar/object.rs +++ b/crates/json-pawarser/src/grammar/object.rs @@ -23,10 +23,10 @@ pub(super) fn object(p: &mut Parser) -> Option { } } - 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) }) }