Пример #1
0
void Input::endMapping() {
  if (EC)
    return;
  // CurrentNode can be null if the document is empty.
  MapHNode *MN = dyn_cast_or_null<MapHNode>(CurrentNode);
  if (!MN)
    return;
  for (const auto &NN : MN->Mapping) {
    if (!MN->isValidKey(NN.first())) {
      setError(NN.second, Twine("unknown key '") + NN.first() + "'");
      break;
    }
  }
}
void Input::endMapping() {
  if (EC)
    return;
  MapHNode *MN = dyn_cast<MapHNode>(CurrentNode);
  if (!MN)
    return;
  for (MapHNode::NameToNode::iterator i = MN->Mapping.begin(),
       End = MN->Mapping.end(); i != End; ++i) {
    if (!MN->isValidKey(i->first)) {
      setError(i->second, Twine("unknown key '") + i->first + "'");
      break;
    }
  }
}