Fix warning related to unreachable-code.

Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com>
pull/5075/head
Jackie9527 2023-04-29 00:29:33 +08:00
parent 5c5b0f97b7
commit a8e7c23605
1 changed files with 2 additions and 2 deletions

View File

@ -190,7 +190,7 @@ Scope::Scope(Parser& parser,bool topLevel)
} }
auto *element = new_Element(*n, parser); auto *element = new_Element(*n, parser);
// Element() should stop at the next Key token (or right after a Close token) // Element() should stop at the next Key token (or right after a Close token)
n = parser.CurrentToken(); n = parser.CurrentToken();
if (n == nullptr) { if (n == nullptr) {
@ -198,8 +198,8 @@ Scope::Scope(Parser& parser,bool topLevel)
elements.insert(ElementMap::value_type(str, element)); elements.insert(ElementMap::value_type(str, element));
return; return;
} }
ParseError("unexpected end of file",parser.LastToken());
delete element; delete element;
ParseError("unexpected end of file",parser.LastToken());
} else { } else {
elements.insert(ElementMap::value_type(str, element)); elements.insert(ElementMap::value_type(str, element));
} }