MCPcopy Create free account
hub / github.com/OpenMW/openmw / getNode

Function getNode

components/lua/yamlloader.cpp:84–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

loadAllFunction · 0.85
getMapFunction · 0.85
getArrayFunction · 0.85

Calls 4

getMapFunction · 0.85
getArrayFunction · 0.85
getScalarFunction · 0.85
nodeErrorFunction · 0.85

Tested by

no test coverage detected