def _create_tree_with_two_struct_references(): root = Root().insert( nodes.Namespace(name="ns").insert( nodes.Structure(name="S1"), nodes.Structure(name="S2"), Archive(name="Archive").insert( res.Multivector(name="resource").insert( refs.StructureReference(name="S1"), refs.StructureReference(name="S2"))))) return SyntaxTree(root)
def _create_tree_resource_to_struct_with_extra_folding(actual, reference): root = Root().insert( nodes.Namespace(name="ns").insert( nodes.Namespace(name="fold").insert(nodes.Structure(name=actual)), Archive(name="Archive").insert( res.Vector(name="resource").insert( refs.StructureReference(name=reference))))) return SyntaxTree(root)
def _create_tree_with_explicit_reference(name): root = Root().insert( nodes.Namespace(name="ns").insert( nodes.Structure(name="Struct").insert(nodes.Field(name="Field")), Archive(name="Archive").insert( res.Vector(name="resource").insert( refs.FieldReference(name="Struct.Field"), refs.ResourceReference(name=name)), res.Vector(name="resource2")))) return SyntaxTree(root)