From 662cb8ba0e7d1243307006cd77f2f952e4a38a41 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Tue, 29 Oct 2024 19:40:50 +0100 Subject: [PATCH] json-pawarser: make return of object grammar easier to understand --- crates/json-pawarser/src/grammar/object.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) }) }