| 82 | } |
| 83 | |
| 84 | sol::object getNode(const YAML::Node& node, const sol::state_view& lua, uint64_t depth) |
| 85 | { |
| 86 | if (depth >= maxDepth) |
| 87 | throw std::runtime_error("Maximum layers depth exceeded, probably caused by a circular reference"); |
| 88 | |
| 89 | ++depth; |
| 90 | |
| 91 | if (node.IsMap()) |
| 92 | return getMap(node, lua, depth); |
| 93 | else if (node.IsSequence()) |
| 94 | return getArray(node, lua, depth); |
| 95 | else if (node.IsScalar()) |
| 96 | return getScalar(node, lua); |
| 97 | else if (node.IsNull()) |
| 98 | return sol::nil; |
| 99 | |
| 100 | nodeError(node, "An unknown YAML node encountered"); |
| 101 | } |
| 102 | |
| 103 | sol::table getMap(const YAML::Node& node, const sol::state_view& lua, uint64_t depth) |
| 104 | { |