updating validation
This commit is contained in:
parent
016ff3723d
commit
97488fe2d8
1 changed files with 9 additions and 1 deletions
|
|
@ -1081,7 +1081,7 @@ func (c *compiler) validateNear(g *d2graph.Graph) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSrcNearConst || isDstNearConst) && srcNearContainer != dstNearContainer {
|
if (isSrcNearConst || isDstNearConst) && srcNearContainer != dstNearContainer {
|
||||||
c.errorf(edge.References[0].Edge, "cannot connect objects from within a container, that has near constant set, to objects outside that container")
|
// c.errorf(edge.References[0].Edge, "cannot connect objects from within a container, that has near constant set, to objects outside that container")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1101,6 +1101,14 @@ func (c *compiler) validateEdges(g *d2graph.Graph) {
|
||||||
c.errorf(edge.GetAstEdge(), "edge from grid diagram %#v cannot enter itself", edge.Dst.AbsID())
|
c.errorf(edge.GetAstEdge(), "edge from grid diagram %#v cannot enter itself", edge.Dst.AbsID())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if edge.Src.Parent.IsGridDiagram() && edge.Dst.IsDescendantOf(edge.Src) {
|
||||||
|
c.errorf(edge.GetAstEdge(), "edge from grid cell %#v cannot enter itself", edge.Src.AbsID())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if edge.Dst.Parent.IsGridDiagram() && edge.Src.IsDescendantOf(edge.Dst) {
|
||||||
|
c.errorf(edge.GetAstEdge(), "edge from grid cell %#v cannot enter itself", edge.Dst.AbsID())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
srcGrid := edge.Src.Parent.ClosestGridDiagram()
|
srcGrid := edge.Src.Parent.ClosestGridDiagram()
|
||||||
dstGrid := edge.Dst.Parent.ClosestGridDiagram()
|
dstGrid := edge.Dst.Parent.ClosestGridDiagram()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue