本文整理汇总了Golang中github.com/serulian/compiler/graphs/typegraph.TypeGraph.GetTypeOrModuleForSourceNode方法的典型用法代码示例。如果您正苦于以下问题:Golang TypeGraph.GetTypeOrModuleForSourceNode方法的具体用法?Golang TypeGraph.GetTypeOrModuleForSourceNode怎么用?Golang TypeGraph.GetTypeOrModuleForSourceNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/serulian/compiler/graphs/typegraph.TypeGraph
的用法示例。
在下文中一共展示了TypeGraph.GetTypeOrModuleForSourceNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DecorateMembers
func (stc *srgTypeConstructor) DecorateMembers(decorater typegraph.GetMemberDecorator, reporter typegraph.IssueReporter, graph *typegraph.TypeGraph) {
// Decorate all module members.
for _, module := range stc.srg.GetModules() {
for _, member := range module.GetMembers() {
parent, _ := graph.GetTypeOrModuleForSourceNode(module.Node())
stc.decorateMember(member, parent, decorater(member.GraphNode), reporter, graph)
}
}
// Decorate all type members.
buildTypeMembers := func(key interface{}, value interface{}) bool {
data := value.(typeMemberWork)
for _, member := range data.srgType.GetMembers() {
parent, _ := graph.GetTypeOrModuleForSourceNode(data.srgType.Node())
stc.decorateMember(member, parent, decorater(member.GraphNode), reporter, graph)
}
return true
}
workqueue := compilerutil.Queue()
for _, srgType := range stc.srg.GetTypes() {
workqueue.Enqueue(srgType.Node(), typeMemberWork{srgType}, buildTypeMembers)
}
workqueue.Run()
}