/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
#include <folly/experimental/DynamicParser.h>
-#include <folly/CppAttributes.h>
#include <folly/Optional.h>
"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_);
}
stackPtr_->value_ = value_;
if (stackPtr_->unmaterializedSubErrorKeys_.empty()) {
// There should be the current error, and the root.
- CHECK_GE(stackPtr_->subErrors_.size(), 2)
+ CHECK_GE(stackPtr_->subErrors_.size(), 2u)
<< "Internal bug: out of suberrors";
stackPtr_->subErrors_.pop_back();
} else {
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