/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2016-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
"Unsupported key type ", key.typeName(), " of ", detail::toPseudoJson(key)
);
}
-} // anonymous namespace
+} // namespace
void DynamicParser::reportError(
const folly::dynamic* lookup_k,
break; // Continue parsing
case OnError::THROW:
stack_.throwErrors(); // Package releaseErrors() into an exception.
- LOG(FATAL) << "Not reached"; // silence lint false positive
default:
LOG(FATAL) << "Bad onError_: " << static_cast<int>(onError_);
}
}
}
-folly::ScopeGuardImpl<DynamicParser::ParserStack::Pop>
-DynamicParser::ParserStack::push(
+DynamicParser::ParserStack::PopGuard DynamicParser::ParserStack::push(
const folly::dynamic& k,
const folly::dynamic& v) noexcept {
// Save the previous state of the parser.
- folly::ScopeGuardImpl<DynamicParser::ParserStack::Pop> guard(
- DynamicParser::ParserStack::Pop(this)
- );
+ DynamicParser::ParserStack::PopGuard guard{this};
key_ = &k;
value_ = &v;
// We create errors_ sub-objects lazily to keep the result small.
return releaseErrorsImpl();
}
-void DynamicParser::ParserStack::throwErrors() {
+[[noreturn]] void DynamicParser::ParserStack::throwErrors() {
throw DynamicParserParseError(releaseErrorsImpl());
}
ss << d;
return ss.str();
}
-} // namespace detail
+} // namespace detail
-} // namespace folly
+} // namespace folly