MGroup
from a node
.REQUIRE node.labels.has("MGroup")
# Build a new `MGroup` from a `node`.
#
# REQUIRE `node.labels.has("MGroup")`
private fun to_mgroup(model: Model, node: NeoNode): MGroup do
var m = mentities.get_or_null(node.id.as(Int))
if m isa MGroup then return m
assert node.labels.has("MGroup")
var location = to_location(node["location"].to_s)
var mpackage = to_mpackage(model, node.out_nodes("PROJECT").first)
var parent: nullable MGroup = null
var out = node.out_nodes("PARENT")
if not out.is_empty then
parent = to_mgroup(model, out.first)
end
var mgroup = new MGroup(node["name"].to_s, location, mpackage, parent)
mentities[node.id.as(Int)] = mgroup
set_doc(node, mgroup)
return mgroup
end
src/neo.nit:361,2--380,4