Pass a mark to BadSubscript exception (#843)

It's clearly related to an existing node, so it can have a mark and give
an error location.
This commit is contained in:
Victor Mataré
2020-04-07 18:33:16 +02:00
committed by GitHub
parent 26faac387c
commit cf93f4c57b
3 changed files with 6 additions and 6 deletions

View File

@@ -196,7 +196,7 @@ void node_data::insert(node& key, node& value, shared_memory_holder pMemory) {
convert_to_map(pMemory);
break;
case NodeType::Scalar:
throw BadSubscript(key);
throw BadSubscript(m_mark, key);
}
insert_map_pair(key, value);
@@ -226,7 +226,7 @@ node& node_data::get(node& key, shared_memory_holder pMemory) {
convert_to_map(pMemory);
break;
case NodeType::Scalar:
throw BadSubscript(key);
throw BadSubscript(m_mark, key);
}
for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {