| 1551 | } |
| 1552 | |
| 1553 | void AnyMap::copyMetadata(const AnyMap& other) |
| 1554 | { |
| 1555 | m_line = other.m_line; |
| 1556 | m_column = other.m_column; |
| 1557 | if (!other.m_metadata) { |
| 1558 | return; |
| 1559 | } |
| 1560 | |
| 1561 | if (m_metadata) { |
| 1562 | // Fork the metadata tree at this point to avoid affecting parent nodes |
| 1563 | m_metadata = make_shared<AnyMap>(*m_metadata); |
| 1564 | } else { |
| 1565 | m_metadata = make_shared<AnyMap>(); |
| 1566 | } |
| 1567 | |
| 1568 | for (const auto& [key, value] : *other.m_metadata) { |
| 1569 | (*m_metadata)[key] = value; |
| 1570 | } |
| 1571 | |
| 1572 | propagateMetadata(m_metadata); |
| 1573 | } |
| 1574 | |
| 1575 | bool AnyMap::getBool(const string& key, bool default_) const |
| 1576 | { |
no outgoing calls