Esempio n. 1
0
func (this *stmtVisitor) graphAttrs(stmt ast.GraphAttrs) ast.Visitor {
	attrs := ast.AttrList(stmt).GetMap()
	for key, value := range attrs {
		this.g.AddAttr(this.graphName, key, value)
	}
	this.currentGraphAttrs = overwrite(this.currentGraphAttrs, attrs)
	return &nilVisitor{}
}
Esempio n. 2
0
func (this *stmtVisitor) edgeAttrs(stmt ast.EdgeAttrs) ast.Visitor {
	attrs, err := fromStringMap(ast.AttrList(stmt).GetMap())
	if err != nil {
		// panic(err) // TODO: Fix this in such a way that the tests don't fail
	}
	this.currentEdgeAttrs = overwrite(this.currentEdgeAttrs, attrs)
	return &nilVisitor{}
}
Esempio n. 3
0
func (this *stmtVisitor) graphAttrs(stmt ast.GraphAttrs) ast.Visitor {
	attrs, err := fromStringMap(ast.AttrList(stmt).GetMap())
	if err != nil {
		// panic(err) // TODO: Fix this in such a way that the tests don't fail
	}
	for key, value := range attrs {
		this.g.AddAttr(this.graphName, key.String(), value)
	}
	this.currentGraphAttrs = overwrite(this.currentGraphAttrs, attrs)
	return &nilVisitor{}
}
Esempio n. 4
0
func (this *stmtVisitor) edgeAttrs(stmt ast.EdgeAttrs) ast.Visitor {
	this.currentEdgeAttrs = overwrite(this.currentEdgeAttrs, ast.AttrList(stmt).GetMap())
	return &nilVisitor{}
}