Merge pull request #1444 from alixander/d2oracle-updates
d2oracle boardPath updates
This commit is contained in:
commit
9af8c7cf8c
15 changed files with 6333 additions and 47 deletions
|
|
@ -726,6 +726,7 @@ func (c *compiler) compileEdge(obj *d2graph.Object, e *d2ir.Edge) {
|
||||||
MapKey: er.Context.Key,
|
MapKey: er.Context.Key,
|
||||||
MapKeyEdgeIndex: er.Context.EdgeIndex(),
|
MapKeyEdgeIndex: er.Context.EdgeIndex(),
|
||||||
Scope: er.Context.Scope,
|
Scope: er.Context.Scope,
|
||||||
|
ScopeAST: er.Context.ScopeAST,
|
||||||
}
|
}
|
||||||
if er.Context.ScopeMap != nil {
|
if er.Context.ScopeMap != nil {
|
||||||
scopeObjIDA := d2graphIDA(d2ir.BoardIDA(er.Context.ScopeMap))
|
scopeObjIDA := d2graphIDA(d2ir.BoardIDA(er.Context.ScopeMap))
|
||||||
|
|
|
||||||
|
|
@ -1117,6 +1117,7 @@ type EdgeReference struct {
|
||||||
MapKeyEdgeIndex int `json:"map_key_edge_index"`
|
MapKeyEdgeIndex int `json:"map_key_edge_index"`
|
||||||
Scope *d2ast.Map `json:"-"`
|
Scope *d2ast.Map `json:"-"`
|
||||||
ScopeObj *Object `json:"-"`
|
ScopeObj *Object `json:"-"`
|
||||||
|
ScopeAST *d2ast.Map `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Edge) GetAstEdge() *d2ast.Edge {
|
func (e *Edge) GetAstEdge() *d2ast.Edge {
|
||||||
|
|
|
||||||
123
d2oracle/edit.go
123
d2oracle/edit.go
|
|
@ -115,7 +115,7 @@ func Set(g *d2graph.Graph, boardPath []string, key string, tag, value *string) (
|
||||||
return recompile(g.AST)
|
return recompile(g.AST)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReconnectEdge(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (_ *d2graph.Graph, err error) {
|
func ReconnectEdge(g *d2graph.Graph, boardPath []string, edgeKey string, srcKey, dstKey *string) (_ *d2graph.Graph, err error) {
|
||||||
mk, err := d2parser.ParseMapKey(edgeKey)
|
mk, err := d2parser.ParseMapKey(edgeKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -130,10 +130,24 @@ func ReconnectEdge(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (_
|
||||||
}
|
}
|
||||||
|
|
||||||
edgeTrimCommon(mk)
|
edgeTrimCommon(mk)
|
||||||
obj := g.Root
|
|
||||||
|
boardG := g
|
||||||
|
baseAST := g.AST
|
||||||
|
|
||||||
|
if len(boardPath) > 0 {
|
||||||
|
// When compiling a nested board, we can read from boardG but only write to baseBoardG
|
||||||
|
boardG = GetBoardGraph(g, boardPath)
|
||||||
|
if boardG == nil {
|
||||||
|
return nil, fmt.Errorf("board %v not found", boardPath)
|
||||||
|
}
|
||||||
|
// TODO beter name
|
||||||
|
baseAST = boardG.BaseAST
|
||||||
|
}
|
||||||
|
|
||||||
|
obj := boardG.Root
|
||||||
if mk.Key != nil {
|
if mk.Key != nil {
|
||||||
var ok bool
|
var ok bool
|
||||||
obj, ok = g.Root.HasChild(d2graph.Key(mk.Key))
|
obj, ok = boardG.Root.HasChild(d2graph.Key(mk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("edge not found")
|
return nil, errors.New("edge not found")
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +181,7 @@ func ReconnectEdge(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (_
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
src, ok = g.Root.HasChild(d2graph.Key(srcmk.Key))
|
src, ok = boardG.Root.HasChild(d2graph.Key(srcmk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("newSrc not found")
|
return nil, errors.New("newSrc not found")
|
||||||
}
|
}
|
||||||
|
|
@ -177,18 +191,26 @@ func ReconnectEdge(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (_
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
dst, ok = g.Root.HasChild(d2graph.Key(dstmk.Key))
|
dst, ok = boardG.Root.HasChild(d2graph.Key(dstmk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("newDst not found")
|
return nil, errors.New("newDst not found")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ref := edge.References[0]
|
refs := edge.References
|
||||||
|
if baseAST != g.AST {
|
||||||
|
refs = getWriteableEdgeRefs(edge, baseAST)
|
||||||
|
if len(refs) == 0 || refs[0].ScopeAST != baseAST {
|
||||||
|
// TODO null
|
||||||
|
return nil, OutsideScopeError{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ref := refs[0]
|
||||||
|
|
||||||
// for loops where only one end is changing, node is always ensured
|
// for loops where only one end is changing, node is always ensured
|
||||||
if edge.Src != edge.Dst && (srcKey == nil || dstKey == nil) {
|
if edge.Src != edge.Dst && (srcKey == nil || dstKey == nil) {
|
||||||
var refEdges []*d2ast.Edge
|
var refEdges []*d2ast.Edge
|
||||||
for _, ref := range edge.References {
|
for _, ref := range refs {
|
||||||
refEdges = append(refEdges, ref.Edge)
|
refEdges = append(refEdges, ref.Edge)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,8 +222,8 @@ func ReconnectEdge(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range edge.References {
|
for i := range refs {
|
||||||
ref := edge.References[i]
|
ref := refs[i]
|
||||||
// it's a chain
|
// it's a chain
|
||||||
if len(ref.MapKey.Edges) > 1 && ref.MapKey.EdgeIndex == nil {
|
if len(ref.MapKey.Edges) > 1 && ref.MapKey.EdgeIndex == nil {
|
||||||
splitChain := true
|
splitChain := true
|
||||||
|
|
@ -232,7 +254,7 @@ func ReconnectEdge(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (_
|
||||||
if src != nil {
|
if src != nil {
|
||||||
srcmk, _ := d2parser.ParseMapKey(*srcKey)
|
srcmk, _ := d2parser.ParseMapKey(*srcKey)
|
||||||
ref.Edge.Src = srcmk.Key
|
ref.Edge.Src = srcmk.Key
|
||||||
newPath, err := pathFromScopeObj(g, srcmk, ref.ScopeObj)
|
newPath, err := pathFromScopeObj(boardG, srcmk, ref.ScopeObj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -241,7 +263,7 @@ func ReconnectEdge(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (_
|
||||||
if dst != nil {
|
if dst != nil {
|
||||||
dstmk, _ := d2parser.ParseMapKey(*dstKey)
|
dstmk, _ := d2parser.ParseMapKey(*dstKey)
|
||||||
ref.Edge.Dst = dstmk.Key
|
ref.Edge.Dst = dstmk.Key
|
||||||
newPath, err := pathFromScopeObj(g, dstmk, ref.ScopeObj)
|
newPath, err := pathFromScopeObj(boardG, dstmk, ref.ScopeObj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -445,15 +467,21 @@ func _set(g *d2graph.Graph, baseAST *d2ast.Map, key string, tag, value *string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return errors.New("edge not found")
|
return errors.New("edge not found")
|
||||||
}
|
}
|
||||||
|
refs := edge.References
|
||||||
|
if baseAST != g.AST {
|
||||||
|
refs = getWriteableEdgeRefs(edge, baseAST)
|
||||||
|
}
|
||||||
onlyInChain := true
|
onlyInChain := true
|
||||||
for _, ref := range edge.References {
|
for _, ref := range refs {
|
||||||
// TODO merge flat edgekeys
|
// TODO merge flat edgekeys
|
||||||
// E.g. this can group into a map
|
// E.g. this can group into a map
|
||||||
// (y -> z)[0].style.opacity: 0.4
|
// (y -> z)[0].style.opacity: 0.4
|
||||||
// (y -> z)[0].style.animated: true
|
// (y -> z)[0].style.animated: true
|
||||||
if len(ref.MapKey.Edges) == 1 && ref.MapKey.EdgeIndex == nil {
|
if len(ref.MapKey.Edges) == 1 {
|
||||||
|
if ref.MapKey.EdgeIndex == nil || ref.MapKey.Value.Map != nil {
|
||||||
onlyInChain = false
|
onlyInChain = false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// If a ref has an exact match on this key, just change the value
|
// If a ref has an exact match on this key, just change the value
|
||||||
tmp1 := *ref.MapKey
|
tmp1 := *ref.MapKey
|
||||||
tmp2 := *mk
|
tmp2 := *mk
|
||||||
|
|
@ -485,7 +513,7 @@ func _set(g *d2graph.Graph, baseAST *d2ast.Map, key string, tag, value *string)
|
||||||
}
|
}
|
||||||
|
|
||||||
foundMap := false
|
foundMap := false
|
||||||
for _, ref := range edge.References {
|
for _, ref := range refs {
|
||||||
// TODO get the most nested one
|
// TODO get the most nested one
|
||||||
if ref.MapKey.Value.Map != nil {
|
if ref.MapKey.Value.Map != nil {
|
||||||
foundMap = true
|
foundMap = true
|
||||||
|
|
@ -1374,6 +1402,7 @@ func deleteEdge(g *d2graph.Graph, scope *d2ast.Map, mk *d2ast.Key, i int) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ensureNode ensures that `k` exists in `scope` if `excludedEdges` were removed
|
||||||
func ensureNode(g *d2graph.Graph, excludedEdges []*d2ast.Edge, scopeObj *d2graph.Object, scope *d2ast.Map, cursor *d2ast.Key, k *d2ast.KeyPath, before bool) {
|
func ensureNode(g *d2graph.Graph, excludedEdges []*d2ast.Edge, scopeObj *d2graph.Object, scope *d2ast.Map, cursor *d2ast.Key, k *d2ast.KeyPath, before bool) {
|
||||||
if k == nil || len(k.Path) == 0 {
|
if k == nil || len(k.Path) == 0 {
|
||||||
return
|
return
|
||||||
|
|
@ -1421,7 +1450,7 @@ func ensureNode(g *d2graph.Graph, excludedEdges []*d2ast.Edge, scopeObj *d2graph
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Rename(g *d2graph.Graph, key, newName string) (_ *d2graph.Graph, newKey string, err error) {
|
func Rename(g *d2graph.Graph, boardPath []string, key, newName string) (_ *d2graph.Graph, newKey string, err error) {
|
||||||
defer xdefer.Errorf(&err, "failed to rename %#v to %#v", key, newName)
|
defer xdefer.Errorf(&err, "failed to rename %#v to %#v", key, newName)
|
||||||
|
|
||||||
mk, err := d2parser.ParseMapKey(key)
|
mk, err := d2parser.ParseMapKey(key)
|
||||||
|
|
@ -1429,6 +1458,15 @@ func Rename(g *d2graph.Graph, key, newName string) (_ *d2graph.Graph, newKey str
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boardG := g
|
||||||
|
|
||||||
|
if len(boardPath) > 0 {
|
||||||
|
boardG = GetBoardGraph(g, boardPath)
|
||||||
|
if boardG == nil {
|
||||||
|
return nil, "", fmt.Errorf("board %v not found", boardPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(mk.Edges) > 0 && mk.EdgeKey == nil {
|
if len(mk.Edges) > 0 && mk.EdgeKey == nil {
|
||||||
// TODO: Not a fan of this dual interpretation depending on mk.Edges.
|
// TODO: Not a fan of this dual interpretation depending on mk.Edges.
|
||||||
// Maybe we remove Rename and just have Move.
|
// Maybe we remove Rename and just have Move.
|
||||||
|
|
@ -1445,12 +1483,12 @@ func Rename(g *d2graph.Graph, key, newName string) (_ *d2graph.Graph, newKey str
|
||||||
return nil, "", fmt.Errorf("cannot rename to reserved keyword: %#v", newName)
|
return nil, "", fmt.Errorf("cannot rename to reserved keyword: %#v", newName)
|
||||||
}
|
}
|
||||||
if mk.Key != nil {
|
if mk.Key != nil {
|
||||||
obj, ok := g.Root.HasChild(d2graph.Key(mk.Key))
|
obj, ok := boardG.Root.HasChild(d2graph.Key(mk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, "", fmt.Errorf("key does not exist")
|
return nil, "", fmt.Errorf("key does not exist")
|
||||||
}
|
}
|
||||||
// If attempt to name something "x", but "x" already exists, rename it "x 2" instead
|
// If attempt to name something "x", but "x" already exists, rename it "x 2" instead
|
||||||
generatedName, _, err := generateUniqueKey(g, newName, obj, nil)
|
generatedName, _, err := generateUniqueKey(boardG, newName, obj, nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
newName = generatedName
|
newName = generatedName
|
||||||
}
|
}
|
||||||
|
|
@ -1459,8 +1497,7 @@ func Rename(g *d2graph.Graph, key, newName string) (_ *d2graph.Graph, newKey str
|
||||||
mk.Key.Path[len(mk.Key.Path)-1] = d2ast.MakeValueBox(d2ast.RawString(newName, true)).StringBox()
|
mk.Key.Path[len(mk.Key.Path)-1] = d2ast.MakeValueBox(d2ast.RawString(newName, true)).StringBox()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
g, err = move(g, boardPath, key, d2format.Format(mk), false)
|
||||||
g, err = move(g, nil, key, d2format.Format(mk), false)
|
|
||||||
return g, newName, err
|
return g, newName, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2188,7 +2225,7 @@ func ReparentIDDelta(g *d2graph.Graph, key, parentKey string) (string, error) {
|
||||||
return id, nil
|
return id, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReconnectEdgeIDDeltas(g *d2graph.Graph, edgeKey string, srcKey, dstKey *string) (deltas map[string]string, err error) {
|
func ReconnectEdgeIDDeltas(g *d2graph.Graph, boardPath []string, edgeKey string, srcKey, dstKey *string) (deltas map[string]string, err error) {
|
||||||
defer xdefer.Errorf(&err, "failed to get deltas for reconnect edge %#v", edgeKey)
|
defer xdefer.Errorf(&err, "failed to get deltas for reconnect edge %#v", edgeKey)
|
||||||
deltas = make(map[string]string)
|
deltas = make(map[string]string)
|
||||||
// Reconnection: nothing is created or destroyed, the edge just gets a new ID
|
// Reconnection: nothing is created or destroyed, the edge just gets a new ID
|
||||||
|
|
@ -2214,10 +2251,21 @@ func ReconnectEdgeIDDeltas(g *d2graph.Graph, edgeKey string, srcKey, dstKey *str
|
||||||
}
|
}
|
||||||
|
|
||||||
edgeTrimCommon(mk)
|
edgeTrimCommon(mk)
|
||||||
obj := g.Root
|
|
||||||
|
boardG := g
|
||||||
|
|
||||||
|
if len(boardPath) > 0 {
|
||||||
|
// When compiling a nested board, we can read from boardG but only write to baseBoardG
|
||||||
|
boardG = GetBoardGraph(g, boardPath)
|
||||||
|
if boardG == nil {
|
||||||
|
return nil, fmt.Errorf("board %v not found", boardPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
obj := boardG.Root
|
||||||
if mk.Key != nil {
|
if mk.Key != nil {
|
||||||
var ok bool
|
var ok bool
|
||||||
obj, ok = g.Root.HasChild(d2graph.Key(mk.Key))
|
obj, ok = boardG.Root.HasChild(d2graph.Key(mk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("edge not found")
|
return nil, errors.New("edge not found")
|
||||||
}
|
}
|
||||||
|
|
@ -2252,7 +2300,7 @@ func ReconnectEdgeIDDeltas(g *d2graph.Graph, edgeKey string, srcKey, dstKey *str
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
src, ok = g.Root.HasChild(d2graph.Key(srcmk.Key))
|
src, ok = boardG.Root.HasChild(d2graph.Key(srcmk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("newSrc not found")
|
return nil, errors.New("newSrc not found")
|
||||||
}
|
}
|
||||||
|
|
@ -2263,7 +2311,7 @@ func ReconnectEdgeIDDeltas(g *d2graph.Graph, edgeKey string, srcKey, dstKey *str
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
dst, ok = g.Root.HasChild(d2graph.Key(dstmk.Key))
|
dst, ok = boardG.Root.HasChild(d2graph.Key(dstmk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("newDst not found")
|
return nil, errors.New("newDst not found")
|
||||||
}
|
}
|
||||||
|
|
@ -2276,7 +2324,7 @@ func ReconnectEdgeIDDeltas(g *d2graph.Graph, edgeKey string, srcKey, dstKey *str
|
||||||
newIndex := 0
|
newIndex := 0
|
||||||
|
|
||||||
// For the edge's own delta, it just needs to know how many edges came before it with the same src and dst
|
// For the edge's own delta, it just needs to know how many edges came before it with the same src and dst
|
||||||
for _, otherEdge := range g.Edges {
|
for _, otherEdge := range boardG.Edges {
|
||||||
if otherEdge.Src == newSrc && otherEdge.Dst == newDst {
|
if otherEdge.Src == newSrc && otherEdge.Dst == newDst {
|
||||||
firstRef := otherEdge.References[0]
|
firstRef := otherEdge.References[0]
|
||||||
if firstRef.MapKey.Range.Start.Line <= line {
|
if firstRef.MapKey.Range.Start.Line <= line {
|
||||||
|
|
@ -2827,7 +2875,7 @@ func DeleteIDDeltas(g *d2graph.Graph, key string) (deltas map[string]string, err
|
||||||
return deltas, nil
|
return deltas, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func RenameIDDeltas(g *d2graph.Graph, key, newName string) (deltas map[string]string, err error) {
|
func RenameIDDeltas(g *d2graph.Graph, boardPath []string, key, newName string) (deltas map[string]string, err error) {
|
||||||
defer xdefer.Errorf(&err, "failed to get deltas for renaming of %#v to %#v", key, newName)
|
defer xdefer.Errorf(&err, "failed to get deltas for renaming of %#v to %#v", key, newName)
|
||||||
deltas = make(map[string]string)
|
deltas = make(map[string]string)
|
||||||
|
|
||||||
|
|
@ -2836,11 +2884,19 @@ func RenameIDDeltas(g *d2graph.Graph, key, newName string) (deltas map[string]st
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boardG := g
|
||||||
|
if len(boardPath) > 0 {
|
||||||
|
boardG = GetBoardGraph(g, boardPath)
|
||||||
|
if boardG == nil {
|
||||||
|
return nil, fmt.Errorf("board %v not found", boardPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
edgeTrimCommon(mk)
|
edgeTrimCommon(mk)
|
||||||
obj := g.Root
|
obj := boardG.Root
|
||||||
if mk.Key != nil {
|
if mk.Key != nil {
|
||||||
var ok bool
|
var ok bool
|
||||||
obj, ok = g.Root.HasChild(d2graph.Key(mk.Key))
|
obj, ok = boardG.Root.HasChild(d2graph.Key(mk.Key))
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
@ -2878,7 +2934,7 @@ func RenameIDDeltas(g *d2graph.Graph, key, newName string) (deltas map[string]st
|
||||||
}
|
}
|
||||||
|
|
||||||
mk.Key.Path[len(mk.Key.Path)-1].Unbox().SetString(newName)
|
mk.Key.Path[len(mk.Key.Path)-1].Unbox().SetString(newName)
|
||||||
uniqueKeyStr, _, err := generateUniqueKey(g, strings.Join(d2graph.Key(mk.Key), "."), obj, nil)
|
uniqueKeyStr, _, err := generateUniqueKey(boardG, strings.Join(d2graph.Key(mk.Key), "."), obj, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -3001,3 +3057,12 @@ func getWriteableRefs(obj *d2graph.Object, writeableAST *d2ast.Map) (out []d2gra
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getWriteableEdgeRefs(edge *d2graph.Edge, writeableAST *d2ast.Map) (out []d2graph.EdgeReference) {
|
||||||
|
for i, ref := range edge.References {
|
||||||
|
if ref.ScopeAST == writeableAST {
|
||||||
|
out = append(out, edge.References[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1897,6 +1897,93 @@ scenarios: {
|
||||||
a: b
|
a: b
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-edge-set",
|
||||||
|
|
||||||
|
text: `a -> b
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
key: `(a -> b)[0].style.opacity`,
|
||||||
|
value: go2.Pointer(`0.2`),
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
|
||||||
|
exp: `a -> b
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
c
|
||||||
|
(a -> b)[0].style.opacity: 0.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-existing-edge-set",
|
||||||
|
|
||||||
|
text: `a -> b
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
a -> b
|
||||||
|
c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
key: `(a -> b)[1].style.opacity`,
|
||||||
|
value: go2.Pointer(`0.2`),
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
|
||||||
|
exp: `a -> b
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
a -> b: {style.opacity: 0.2}
|
||||||
|
c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-arrowhead",
|
||||||
|
|
||||||
|
text: `a -> b: {
|
||||||
|
target-arrowhead.shape: triangle
|
||||||
|
}
|
||||||
|
x -> y
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
(a -> b)[0]: {
|
||||||
|
target-arrowhead.shape: circle
|
||||||
|
}
|
||||||
|
c -> d
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
key: `(a -> b)[0].target-arrowhead.shape`,
|
||||||
|
value: go2.Pointer(`diamond`),
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
|
||||||
|
exp: `a -> b: {
|
||||||
|
target-arrowhead.shape: triangle
|
||||||
|
}
|
||||||
|
x -> y
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
(a -> b)[0]: {
|
||||||
|
target-arrowhead.shape: diamond
|
||||||
|
}
|
||||||
|
c -> d
|
||||||
|
}
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -1926,6 +2013,7 @@ func TestReconnectEdge(t *testing.T) {
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
|
boardPath []string
|
||||||
text string
|
text string
|
||||||
edgeKey string
|
edgeKey string
|
||||||
newSrc string
|
newSrc string
|
||||||
|
|
@ -2196,6 +2284,96 @@ x
|
||||||
newDst: "x",
|
newDst: "x",
|
||||||
expErr: "newDst not found",
|
expErr: "newDst not found",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "layers-basic",
|
||||||
|
text: `a
|
||||||
|
|
||||||
|
layers: {
|
||||||
|
x: {
|
||||||
|
b
|
||||||
|
c
|
||||||
|
a -> b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
edgeKey: `(a -> b)[0]`,
|
||||||
|
newDst: "c",
|
||||||
|
exp: `a
|
||||||
|
|
||||||
|
layers: {
|
||||||
|
x: {
|
||||||
|
b
|
||||||
|
c
|
||||||
|
a -> c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-basic",
|
||||||
|
text: `a
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
b
|
||||||
|
c
|
||||||
|
a -> b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
edgeKey: `(a -> b)[0]`,
|
||||||
|
newDst: "c",
|
||||||
|
exp: `a
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
b
|
||||||
|
c
|
||||||
|
a -> c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-outer-scope",
|
||||||
|
text: `a
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
d -> b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
edgeKey: `(d -> b)[0]`,
|
||||||
|
newDst: "a",
|
||||||
|
exp: `a
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
d -> a
|
||||||
|
b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-chain",
|
||||||
|
text: `a -> b -> c
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
d
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
edgeKey: `(a -> b)[0]`,
|
||||||
|
newDst: "d",
|
||||||
|
expErr: `operation would modify AST outside of given scope`,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
|
@ -2214,7 +2392,7 @@ x
|
||||||
if tc.newDst != "" {
|
if tc.newDst != "" {
|
||||||
newDst = &tc.newDst
|
newDst = &tc.newDst
|
||||||
}
|
}
|
||||||
return d2oracle.ReconnectEdge(g, tc.edgeKey, newSrc, newDst)
|
return d2oracle.ReconnectEdge(g, tc.boardPath, tc.edgeKey, newSrc, newDst)
|
||||||
},
|
},
|
||||||
|
|
||||||
exp: tc.exp,
|
exp: tc.exp,
|
||||||
|
|
@ -2231,6 +2409,7 @@ func TestRename(t *testing.T) {
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
|
boardPath []string
|
||||||
|
|
||||||
text string
|
text string
|
||||||
key string
|
key string
|
||||||
|
|
@ -2646,6 +2825,95 @@ more.(ok.q.z -> p.k): "furbling, v.:"
|
||||||
newName: "near",
|
newName: "near",
|
||||||
expErr: `failed to rename "x.icon" to "near": cannot rename to reserved keyword: "near"`,
|
expErr: `failed to rename "x.icon" to "near": cannot rename to reserved keyword: "near"`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "layers-basic",
|
||||||
|
|
||||||
|
text: `x
|
||||||
|
|
||||||
|
layers: {
|
||||||
|
y: {
|
||||||
|
a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"y"},
|
||||||
|
key: "a",
|
||||||
|
newName: "b",
|
||||||
|
|
||||||
|
exp: `x
|
||||||
|
|
||||||
|
layers: {
|
||||||
|
y: {
|
||||||
|
b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-basic",
|
||||||
|
|
||||||
|
text: `x
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
y: {
|
||||||
|
a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"y"},
|
||||||
|
key: "a",
|
||||||
|
newName: "b",
|
||||||
|
|
||||||
|
exp: `x
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
y: {
|
||||||
|
b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-conflict",
|
||||||
|
|
||||||
|
text: `x
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
y: {
|
||||||
|
a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"y"},
|
||||||
|
key: "a",
|
||||||
|
newName: "x",
|
||||||
|
|
||||||
|
exp: `x
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
y: {
|
||||||
|
x 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-scope-err",
|
||||||
|
|
||||||
|
text: `x
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
y: {
|
||||||
|
a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"y"},
|
||||||
|
key: "x",
|
||||||
|
newName: "b",
|
||||||
|
|
||||||
|
expErr: `failed to rename "x" to "b": operation would modify AST outside of given scope`,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
|
@ -2658,7 +2926,7 @@ more.(ok.q.z -> p.k): "furbling, v.:"
|
||||||
testFunc: func(g *d2graph.Graph) (*d2graph.Graph, error) {
|
testFunc: func(g *d2graph.Graph) (*d2graph.Graph, error) {
|
||||||
objectsBefore := len(g.Objects)
|
objectsBefore := len(g.Objects)
|
||||||
var err error
|
var err error
|
||||||
g, _, err = d2oracle.Rename(g, tc.key, tc.newName)
|
g, _, err = d2oracle.Rename(g, tc.boardPath, tc.key, tc.newName)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
objectsAfter := len(g.Objects)
|
objectsAfter := len(g.Objects)
|
||||||
if objectsBefore != objectsAfter {
|
if objectsBefore != objectsAfter {
|
||||||
|
|
@ -6753,6 +7021,7 @@ func TestReconnectEdgeIDDeltas(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
|
|
||||||
|
boardPath []string
|
||||||
text string
|
text string
|
||||||
edge string
|
edge string
|
||||||
newSrc string
|
newSrc string
|
||||||
|
|
@ -6913,6 +7182,42 @@ b
|
||||||
exp: `{
|
exp: `{
|
||||||
"(a -> c)[0]": "(a -> b)[0]",
|
"(a -> c)[0]": "(a -> b)[0]",
|
||||||
"(a -> c)[1]": "(a -> c)[0]"
|
"(a -> c)[1]": "(a -> c)[0]"
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-outer-scope",
|
||||||
|
text: `a
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
d -> b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
edge: `(d -> b)[0]`,
|
||||||
|
newDst: "a",
|
||||||
|
exp: `{
|
||||||
|
"(d -> b)[0]": "(d -> a)[0]"
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-second",
|
||||||
|
text: `g
|
||||||
|
a -> b
|
||||||
|
d
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
x: {
|
||||||
|
d -> b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"x"},
|
||||||
|
edge: `(d -> b)[0]`,
|
||||||
|
newSrc: "a",
|
||||||
|
exp: `{
|
||||||
|
"(d -> b)[0]": "(a -> b)[1]"
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -6937,7 +7242,7 @@ b
|
||||||
newDst = &tc.newDst
|
newDst = &tc.newDst
|
||||||
}
|
}
|
||||||
|
|
||||||
deltas, err := d2oracle.ReconnectEdgeIDDeltas(g, tc.edge, newSrc, newDst)
|
deltas, err := d2oracle.ReconnectEdgeIDDeltas(g, tc.boardPath, tc.edge, newSrc, newDst)
|
||||||
if tc.expErr != "" {
|
if tc.expErr != "" {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("expected error with: %q", tc.expErr)
|
t.Fatalf("expected error with: %q", tc.expErr)
|
||||||
|
|
@ -7756,6 +8061,7 @@ func TestRenameIDDeltas(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
|
|
||||||
|
boardPath []string
|
||||||
text string
|
text string
|
||||||
key string
|
key string
|
||||||
newName string
|
newName string
|
||||||
|
|
@ -7884,6 +8190,44 @@ x.y.z.w.e.p.l -> x.y.z.1.2.3.4
|
||||||
|
|
||||||
exp: `{
|
exp: `{
|
||||||
"x.y.z.(w.e.p.l -> 1.2.3.4)[1]": "x.y.z.(w.e.p.l <-> 1.2.3.4)[1]"
|
"x.y.z.(w.e.p.l -> 1.2.3.4)[1]": "x.y.z.(w.e.p.l <-> 1.2.3.4)[1]"
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "layers-basic",
|
||||||
|
|
||||||
|
text: `x
|
||||||
|
|
||||||
|
layers: {
|
||||||
|
y: {
|
||||||
|
a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"y"},
|
||||||
|
key: "a",
|
||||||
|
newName: "b",
|
||||||
|
|
||||||
|
exp: `{
|
||||||
|
"a": "b"
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scenarios-conflict",
|
||||||
|
|
||||||
|
text: `x
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
y: {
|
||||||
|
a
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
boardPath: []string{"y"},
|
||||||
|
key: "a",
|
||||||
|
newName: "x",
|
||||||
|
|
||||||
|
exp: `{
|
||||||
|
"a": "x 2"
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -7899,7 +8243,7 @@ x.y.z.w.e.p.l -> x.y.z.1.2.3.4
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
deltas, err := d2oracle.RenameIDDeltas(g, tc.key, tc.newName)
|
deltas, err := d2oracle.RenameIDDeltas(g, tc.boardPath, tc.key, tc.newName)
|
||||||
if tc.expErr != "" {
|
if tc.expErr != "" {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("expected error with: %q", tc.expErr)
|
t.Fatalf("expected error with: %q", tc.expErr)
|
||||||
|
|
|
||||||
589
testdata/d2oracle/TestReconnectEdge/layers-basic.exp.json
generated
vendored
Normal file
589
testdata/d2oracle/TestReconnectEdge/layers-basic.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,589 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,0:0:0-9:0:49",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,2:0:3-8:1:48",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,2:0:3-2:6:9",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,2:0:3-2:6:9",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "layers",
|
||||||
|
"raw_string": "layers"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,2:8:11-8:1:48",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,3:2:15-7:3:46",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,3:2:15-3:3:16",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,3:2:15-3:3:16",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,3:5:18-7:3:46",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,5:4:30-5:5:31",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,5:4:30-5:5:31",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,5:4:30-5:5:31",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:4:36-6:10:42",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:4:36-6:10:42",
|
||||||
|
"src": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:4:36-6:5:37",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:4:36-6:5:37",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:9:41-6:10:42",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:9:41-6:10:42",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"layers": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"src": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"index": 0,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c",
|
||||||
|
"id_val": "c",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,5:4:30-5:5:31",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,5:4:30-5:5:31",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:9:41-6:10:42",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:9:41-6:10:42",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "c"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:4:36-6:5:37",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/layers-basic.d2,6:4:36-6:5:37",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
609
testdata/d2oracle/TestReconnectEdge/scenarios-basic.exp.json
generated
vendored
Normal file
609
testdata/d2oracle/TestReconnectEdge/scenarios-basic.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,609 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-9:0:52",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,2:0:3-8:1:51",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,2:0:3-2:9:12",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,2:0:3-2:9:12",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "scenarios",
|
||||||
|
"raw_string": "scenarios"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,2:11:14-8:1:51",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,3:2:18-7:3:49",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,3:2:18-3:3:19",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,3:2:18-3:3:19",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,3:5:21-7:3:49",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,5:4:33-5:5:34",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,5:4:33-5:5:34",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,5:4:33-5:5:34",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:4:39-6:10:45",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:4:39-6:10:45",
|
||||||
|
"src": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:4:39-6:5:40",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:4:39-6:5:40",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:9:44-6:10:45",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:9:44-6:10:45",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scenarios": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"src": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"index": 0,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:4:39-6:5:40",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:4:39-6:5:40",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c",
|
||||||
|
"id_val": "c",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,5:4:33-5:5:34",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,5:4:33-5:5:34",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:9:44-6:10:45",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-basic.d2,6:9:44-6:10:45",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "c"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
4
testdata/d2oracle/TestReconnectEdge/scenarios-chain.exp.json
generated
vendored
Normal file
4
testdata/d2oracle/TestReconnectEdge/scenarios-chain.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"graph": null,
|
||||||
|
"err": "d2oracle.OutsideScopeError{}"
|
||||||
|
}
|
||||||
566
testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.exp.json
generated
vendored
Normal file
566
testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,566 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-8:0:46",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-0:1:1",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,2:0:3-7:1:45",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,2:0:3-2:9:12",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,2:0:3-2:9:12",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "scenarios",
|
||||||
|
"raw_string": "scenarios"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,2:11:14-7:1:45",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,3:2:18-6:3:43",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,3:2:18-3:3:19",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,3:2:18-3:3:19",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,3:5:21-6:3:43",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:4:27-4:10:33",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:4:27-4:10:33",
|
||||||
|
"src": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:4:27-4:5:28",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:4:27-4:5:28",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "d",
|
||||||
|
"raw_string": "d"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:9:32-4:10:33",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:9:32-4:10:33",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,5:4:38-5:5:39",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,5:4:38-5:5:39",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,5:4:38-5:5:39",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scenarios": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "d"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"src": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "d"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"index": 0,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:9:32-4:10:33",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:9:32-4:10:33",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d",
|
||||||
|
"id_val": "d",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:4:27-4:5:28",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,4:4:27-4:5:28",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "d",
|
||||||
|
"raw_string": "d"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "d"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,5:4:38-5:5:39",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestReconnectEdge/scenarios-outer-scope.d2,5:4:38-5:5:39",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
291
testdata/d2oracle/TestRename/layers-basic.exp.json
generated
vendored
Normal file
291
testdata/d2oracle/TestRename/layers-basic.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,291 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,0:0:0-7:0:32",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,2:0:3-6:1:31",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,2:0:3-2:6:9",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,2:0:3-2:6:9",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "layers",
|
||||||
|
"raw_string": "layers"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,2:8:11-6:1:31",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,3:2:15-5:3:29",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,3:2:15-3:3:16",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,3:2:15-3:3:16",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "y",
|
||||||
|
"raw_string": "y"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,3:5:18-5:3:29",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "x",
|
||||||
|
"id_val": "x",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "x"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"layers": [
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/layers-basic.d2,4:4:24-4:5:25",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
358
testdata/d2oracle/TestRename/scenarios-basic.exp.json
generated
vendored
Normal file
358
testdata/d2oracle/TestRename/scenarios-basic.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,358 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-7:0:35",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,2:0:3-6:1:34",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,2:0:3-2:9:12",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,2:0:3-2:9:12",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "scenarios",
|
||||||
|
"raw_string": "scenarios"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,2:11:14-6:1:34",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,3:2:18-5:3:32",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,3:2:18-3:3:19",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,3:2:18-3:3:19",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "y",
|
||||||
|
"raw_string": "y"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,3:5:21-5:3:32",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "x",
|
||||||
|
"id_val": "x",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "x"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scenarios": [
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "x",
|
||||||
|
"id_val": "x",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "x"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-basic.d2,4:4:27-4:5:28",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
358
testdata/d2oracle/TestRename/scenarios-conflict.exp.json
generated
vendored
Normal file
358
testdata/d2oracle/TestRename/scenarios-conflict.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,358 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-7:0:37",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-0:1:1",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,2:0:3-6:1:36",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,2:0:3-2:9:12",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,2:0:3-2:9:12",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "scenarios",
|
||||||
|
"raw_string": "scenarios"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,2:11:14-6:1:36",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,3:2:18-5:3:34",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,3:2:18-3:3:19",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,3:2:18-3:3:19",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "y",
|
||||||
|
"raw_string": "y"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,3:5:21-5:3:34",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,4:4:27-4:7:30",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,4:4:27-4:7:30",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,4:4:27-4:7:30",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x 2",
|
||||||
|
"raw_string": "x 2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "x",
|
||||||
|
"id_val": "x",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "x"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scenarios": [
|
||||||
|
{
|
||||||
|
"name": "y",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x 2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": null,
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "x",
|
||||||
|
"id_val": "x",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "x"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "x 2",
|
||||||
|
"id_val": "x 2",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,4:4:27-4:7:30",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestRename/scenarios-conflict.d2,4:4:27-4:7:30",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x 2",
|
||||||
|
"raw_string": "x 2"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "x 2"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
4
testdata/d2oracle/TestRename/scenarios-scope-err.exp.json
generated
vendored
Normal file
4
testdata/d2oracle/TestRename/scenarios-scope-err.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"graph": null,
|
||||||
|
"err": "failed to rename \"x\" to \"b\": operation would modify AST outside of given scope"
|
||||||
|
}
|
||||||
1433
testdata/d2oracle/TestSet/scenarios-arrowhead.exp.json
generated
vendored
Normal file
1433
testdata/d2oracle/TestSet/scenarios-arrowhead.exp.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
792
testdata/d2oracle/TestSet/scenarios-edge-set.exp.json
generated
vendored
Normal file
792
testdata/d2oracle/TestSet/scenarios-edge-set.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,792 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-8:0:75",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:6:6",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:6:6",
|
||||||
|
"src": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,2:0:8-7:1:74",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,2:0:8-2:9:17",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,2:0:8-2:9:17",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "scenarios",
|
||||||
|
"raw_string": "scenarios"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,2:11:19-7:1:74",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,3:2:23-6:3:72",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,3:2:23-3:3:24",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,3:2:23-3:3:24",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,3:5:26-6:3:72",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:4:38-5:34:68",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:5:39-5:11:45",
|
||||||
|
"src": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:5:39-5:6:40",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:5:39-5:6:40",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:10:44-5:11:45",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:10:44-5:11:45",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"edge_index": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:12:46-5:15:49",
|
||||||
|
"int": 0,
|
||||||
|
"glob": false
|
||||||
|
},
|
||||||
|
"edge_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:16:50-5:29:63",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:16:50-5:21:55",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "style",
|
||||||
|
"raw_string": "style"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:22:56-5:29:63",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "opacity",
|
||||||
|
"raw_string": "opacity"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"number": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:31:65-5:34:68",
|
||||||
|
"raw": "0.2",
|
||||||
|
"value": "1/5"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"index": 0,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scenarios": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"src": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "style"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "opacity"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {
|
||||||
|
"number": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:31:65-5:34:68",
|
||||||
|
"raw": "0.2",
|
||||||
|
"value": "1/5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"index": 0,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {
|
||||||
|
"opacity": {
|
||||||
|
"value": "0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:5:39-5:6:40",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:5:39-5:6:40",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:10:44-5:11:45",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,5:10:44-5:11:45",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c",
|
||||||
|
"id_val": "c",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "c"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
871
testdata/d2oracle/TestSet/scenarios-existing-edge-set.exp.json
generated
vendored
Normal file
871
testdata/d2oracle/TestSet/scenarios-existing-edge-set.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,871 @@
|
||||||
|
{
|
||||||
|
"graph": {
|
||||||
|
"name": "",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-8:0:73",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:6:6",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:6:6",
|
||||||
|
"src": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,2:0:8-7:1:72",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,2:0:8-2:9:17",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,2:0:8-2:9:17",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "scenarios",
|
||||||
|
"raw_string": "scenarios"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,2:11:19-7:1:72",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,3:2:23-6:3:70",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,3:2:23-3:3:24",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,3:2:23-3:3:24",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "x",
|
||||||
|
"raw_string": "x"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,3:5:26-6:3:70",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:4:32-4:32:60",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:4:32-4:10:38",
|
||||||
|
"src": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:9:37-4:10:38",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:9:37-4:10:38",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:12:40-4:32:60",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:13:41-4:31:59",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:13:41-4:26:54",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:13:41-4:18:46",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "style",
|
||||||
|
"raw_string": "style"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:19:47-4:26:54",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "opacity",
|
||||||
|
"raw_string": "opacity"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"number": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:28:56-4:31:59",
|
||||||
|
"raw": "0.2",
|
||||||
|
"value": "1/5"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,5:4:65-5:5:66",
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,5:4:65-5:5:66",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,5:4:65-5:5:66",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"index": 0,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scenarios": [
|
||||||
|
{
|
||||||
|
"name": "x",
|
||||||
|
"isFolderOnly": false,
|
||||||
|
"ast": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"src": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"src": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"src_arrow": "",
|
||||||
|
"dst": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"dst_arrow": ">"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "style"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {},
|
||||||
|
"value": {
|
||||||
|
"map": {
|
||||||
|
"range": ",1:0:0-2:0:0",
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"map_key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"key": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": ",0:0:0-0:0:0",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "opacity"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"primary": {
|
||||||
|
"number": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:28:56-4:31:59",
|
||||||
|
"raw": "0.2",
|
||||||
|
"value": "1/5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"id": "",
|
||||||
|
"id_val": "",
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"index": 0,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"index": 1,
|
||||||
|
"isCurve": false,
|
||||||
|
"src_arrow": false,
|
||||||
|
"dst_arrow": true,
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {
|
||||||
|
"opacity": {
|
||||||
|
"value": "0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"objects": [
|
||||||
|
{
|
||||||
|
"id": "a",
|
||||||
|
"id_val": "a",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:0:0-0:1:1",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:4:32-4:5:33",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "a",
|
||||||
|
"raw_string": "a"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "a"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b",
|
||||||
|
"id_val": "b",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,0:5:5-0:6:6",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:9:37-4:10:38",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,4:9:37-4:10:38",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "b",
|
||||||
|
"raw_string": "b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "b"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c",
|
||||||
|
"id_val": "c",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,5:4:65-5:5:66",
|
||||||
|
"path": [
|
||||||
|
{
|
||||||
|
"unquoted_string": {
|
||||||
|
"range": "d2/testdata/d2oracle/TestSet/scenarios-existing-edge-set.d2,5:4:65-5:5:66",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"string": "c",
|
||||||
|
"raw_string": "c"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"key_path_index": 0,
|
||||||
|
"map_key_edge_index": -1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": {
|
||||||
|
"label": {
|
||||||
|
"value": "c"
|
||||||
|
},
|
||||||
|
"labelDimensions": {
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
},
|
||||||
|
"style": {},
|
||||||
|
"near_key": null,
|
||||||
|
"shape": {
|
||||||
|
"value": "rectangle"
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"constraint": null
|
||||||
|
},
|
||||||
|
"zIndex": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"err": "<nil>"
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue