9 #include "boost/algorithm/string.hpp" 20 using namespace fhicl;
59 return std::any_cast<
table_t const&>(ex_val.value).
begin();
65 return std::any_cast<
table_t const&>(ex_val.value).
end();
73 return std::any_cast<
table_t const&>(ex_val.value).
empty();
82 std::any
const&
value)
90 auto found_val = pre_insert_(key, value);
91 bool result = (found_val !=
nullptr);
101 auto found_val = pre_insert_(key,
value);
102 bool result = (found_val !=
nullptr);
117 }
else if (std::isdigit(
name[0])) {
120 <<
"-- not a sequence (at part \"" <<
name <<
"\")";
122 unsigned i = std::atoi(
name.c_str());
129 <<
"-- not a table (at part \"" <<
name <<
"\")";
131 auto it =
t.find(
name);
148 }
else if (std::isdigit(
name[0])) {
153 unsigned i = std::atoi(
name.c_str());
163 auto it =
t.find(
name);
180 auto t(std::any_cast<table_t>(&
p->value));
184 (((it =
t->find(names[0])) ==
t->end()) || it->second.in_prolog)) {
187 bool at_sequence(
false);
188 for (
auto const&
name : names) {
190 }
else if (std::isdigit(
name[0])) {
193 <<
"-- not a sequence (at part \"" <<
name <<
"\")";
195 unsigned i = std::atoi(
name.c_str());
204 <<
"-- not a table (at part \"" <<
name <<
"\")";
208 if (it ==
t->end()) {
212 auto prot =
p->protection;
213 if (prot == Protection::PROTECT_ERROR) {
216 "\" of specification to be erased\n") :
218 <<
'"' <<
name <<
"\" is protected on " <<
p->pretty_src_info()
220 }
else if (prot == Protection::PROTECT_IGNORE) {
228 if (it !=
t->end()) {
238 auto&
t = std::any_cast<
table_t&>(ex_val.value);
240 auto it =
t.find(names[0]);
241 if (it !=
t.end() && it->second.in_prolog) {
245 auto located = locate_(key, value.
in_prolog);
246 if ((!located.first->is_a(
NIL)) &&
247 value.
protection > located.first->protection) {
249 <<
'"' << key <<
"\" cannot be assigned with increased protection" 250 <<
"\n(previous definition on " << located.first->pretty_src_info()
253 return located.second ? located.first :
nullptr;
256 std::pair<extended_value*, bool>
259 std::pair<extended_value*, bool>
result(
nullptr,
true);
264 }
else if (std::isdigit(
name[0])) {
270 <<
"-- not a sequence (at part \"" <<
name <<
"\")";
272 unsigned i = std::atoi(
name.c_str());
273 while (
s.
size() <= i) {
274 s.push_back(nil_item());
285 <<
"-- not a table (at part \"" <<
name <<
"\")";
289 p = &
t.emplace(
name, nil_item()).first->second;
290 p->set_prolog(in_prolog);
294 if (prot == Protection::PROTECT_ERROR) {
297 "\" of specification to be overwritten\n") :
299 <<
'"' << key <<
"\" is protected on " << p->
pretty_src_info() <<
'\n';
300 }
else if (prot == Protection::PROTECT_IGNORE) {
301 result.second =
false;
309 std::vector<std::string>
313 std::vector<std::string>
result;
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
intermediate_table::complex_t complex_t
bool isSnippetMode(bool m)
bool is_a(value_tag const t) const noexcept
bool exists(std::string path)
fhicl::extended_value::sequence_t sequence_t
intermediate_table::atom_t atom_t
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
void split(std::string const &s, char c, OutIter dest)
std::string pretty_src_info() const
static std::vector< std::string > const names
void set_prolog(bool new_prolog_state)
cet::coded_exception< error, detail::translate > exception
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.