d2ir: Make globs more ergonomic in two specific edge cases
Were identified from @alixander writing documentation.
This commit is contained in:
parent
73e4e68fb8
commit
9c37d6dcfb
9 changed files with 2009 additions and 1271 deletions
|
|
@ -105,6 +105,10 @@ func assertQuery(t testing.TB, n d2ir.Node, nfields, nedges int, primary interfa
|
|||
}
|
||||
}
|
||||
|
||||
if len(na) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return na[0]
|
||||
}
|
||||
|
||||
|
|
|
|||
25
d2ir/d2ir.go
25
d2ir/d2ir.go
|
|
@ -587,6 +587,19 @@ func (m *Map) FieldCountRecursive() int {
|
|||
return acc
|
||||
}
|
||||
|
||||
func (m *Map) IsContainer() bool {
|
||||
if m == nil {
|
||||
return false
|
||||
}
|
||||
for _, f := range m.Fields {
|
||||
_, isReserved := d2graph.ReservedKeywords[f.Name]
|
||||
if !isReserved {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Map) EdgeCountRecursive() int {
|
||||
if m == nil {
|
||||
return 0
|
||||
|
|
@ -1066,6 +1079,18 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error {
|
|||
|
||||
for _, src := range srcFA {
|
||||
for _, dst := range dstFA {
|
||||
if src == dst && (len(srcFA) > 1 || len(dstFA) > 1) {
|
||||
// Globs do not make self edges.
|
||||
continue
|
||||
}
|
||||
|
||||
// If either has a double glob at the end we only select leafs, those without children.
|
||||
if srcKP.Path[len(srcKP.Path)-1].ScalarString() == "**" || dstKP.Path[len(dstKP.Path)-1].ScalarString() == "**" {
|
||||
if src.Map().IsContainer() || dst.Map().IsContainer() {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
eid2 := eid.Copy()
|
||||
eid2.SrcPath = RelIDA(m, src)
|
||||
eid2.DstPath = RelIDA(m, dst)
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ a*n*t*.constant.t*ink*r*t*inke*: globbed`)
|
|||
animal
|
||||
an* -> an*`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 2, 4, nil, "")
|
||||
assertQuery(t, m, 2, 2, nil, "")
|
||||
assertQuery(t, m, 0, 0, nil, "(animate -> animal)[0]")
|
||||
assertQuery(t, m, 0, 0, nil, "(animal -> animal)[0]")
|
||||
},
|
||||
|
|
@ -138,10 +138,10 @@ an* -> an*`)
|
|||
shared.animal
|
||||
sh*.(an* -> an*)`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 3, 4, nil, "")
|
||||
assertQuery(t, m, 2, 4, nil, "shared")
|
||||
assertQuery(t, m, 3, 2, nil, "")
|
||||
assertQuery(t, m, 2, 2, nil, "shared")
|
||||
assertQuery(t, m, 0, 0, nil, "shared.(animate -> animal)[0]")
|
||||
assertQuery(t, m, 0, 0, nil, "shared.(animal -> animal)[0]")
|
||||
assertQuery(t, m, 0, 0, nil, "shared.(animal -> animate)[0]")
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -151,8 +151,8 @@ sh*.(an* -> an*)`)
|
|||
shared.animal
|
||||
sh*.an* -> sh*.an*`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 3, 4, nil, "")
|
||||
assertQuery(t, m, 2, 4, nil, "shared")
|
||||
assertQuery(t, m, 3, 2, nil, "")
|
||||
assertQuery(t, m, 2, 2, nil, "shared")
|
||||
assertQuery(t, m, 0, 0, nil, "shared.(animate -> animal)[0]")
|
||||
assertQuery(t, m, 0, 0, nil, "shared.(animal -> animal)[0]")
|
||||
},
|
||||
|
|
@ -189,6 +189,23 @@ c -> b
|
|||
assertQuery(t, m, 0, 0, "red", "(c -> b)[0].style.fill")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "edge-nexus",
|
||||
run: func(t testing.TB) {
|
||||
m, err := compile(t, `a
|
||||
b
|
||||
c
|
||||
d
|
||||
* -> nexus
|
||||
`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 5, 4, nil, "")
|
||||
assertQuery(t, m, 0, 0, nil, "(a -> nexus)[0]")
|
||||
assertQuery(t, m, 0, 0, nil, "(b -> nexus)[0]")
|
||||
assertQuery(t, m, 0, 0, nil, "(c -> nexus)[0]")
|
||||
assertQuery(t, m, 0, 0, nil, "(d -> nexus)[0]")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "double-glob/1",
|
||||
run: func(t testing.TB) {
|
||||
|
|
@ -205,6 +222,22 @@ shared.animal
|
|||
assertQuery(t, m, 1, 0, nil, "shared.animal.style")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "double-glob/edge-no-container",
|
||||
run: func(t testing.TB) {
|
||||
m, err := compile(t, `zone A: {
|
||||
machine A
|
||||
machine B: {
|
||||
submachine A
|
||||
submachine B
|
||||
}
|
||||
}
|
||||
zone A.** -> load balancer
|
||||
`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 6, 3, nil, "")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "reserved",
|
||||
run: func(t testing.TB) {
|
||||
|
|
@ -220,7 +253,7 @@ Spiderman 3
|
|||
|
||||
* -> *: arrow`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 6, 9, nil, "")
|
||||
assertQuery(t, m, 6, 6, nil, "")
|
||||
assertQuery(t, m, 0, 0, "arrow", "(* -> *)[*]")
|
||||
},
|
||||
},
|
||||
|
|
|
|||
1161
testdata/d2ir/TestCompile/patterns/double-glob/edge-no-container.exp.json
generated
vendored
Normal file
1161
testdata/d2ir/TestCompile/patterns/double-glob/edge-no-container.exp.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
779
testdata/d2ir/TestCompile/patterns/edge-nexus.exp.json
generated
vendored
Normal file
779
testdata/d2ir/TestCompile/patterns/edge-nexus.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,779 @@
|
|||
{
|
||||
"fields": [
|
||||
{
|
||||
"name": "a",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "b",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "c",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "c",
|
||||
"raw_string": "c"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "c",
|
||||
"raw_string": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "c",
|
||||
"raw_string": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "d",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "d",
|
||||
"raw_string": "d"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "d",
|
||||
"raw_string": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "d",
|
||||
"raw_string": "d"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "nexus",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"a"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"nexus"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"b"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"nexus"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"c"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"nexus"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"d"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"nexus"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "nexus",
|
||||
"raw_string": "nexus"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
234
testdata/d2ir/TestCompile/patterns/edge/1.exp.json
generated
vendored
234
testdata/d2ir/TestCompile/patterns/edge/1.exp.json
generated
vendored
|
|
@ -114,123 +114,6 @@
|
|||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"animate"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"animate"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
|
|
@ -464,123 +347,6 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"animal"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"animal"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
274
testdata/d2ir/TestCompile/patterns/edge/2.exp.json
generated
vendored
274
testdata/d2ir/TestCompile/patterns/edge/2.exp.json
generated
vendored
|
|
@ -162,143 +162,6 @@
|
|||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"animate"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"animate"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
|
|
@ -572,143 +435,6 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"animal"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"animal"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
354
testdata/d2ir/TestCompile/patterns/edge/3.exp.json
generated
vendored
354
testdata/d2ir/TestCompile/patterns/edge/3.exp.json
generated
vendored
|
|
@ -162,183 +162,6 @@
|
|||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"animate"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"animate"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
|
|
@ -692,183 +515,6 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"animal"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"animal"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "sh*",
|
||||
"raw_string": "sh*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"sh",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47",
|
||||
"value": [
|
||||
{
|
||||
"string": "an*",
|
||||
"raw_string": "an*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"an",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
402
testdata/d2ir/TestCompile/patterns/reserved.exp.json
generated
vendored
402
testdata/d2ir/TestCompile/patterns/reserved.exp.json
generated
vendored
|
|
@ -476,140 +476,6 @@
|
|||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"Spiderman 1"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"Spiderman 1"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103",
|
||||
"value": [
|
||||
{
|
||||
"string": "arrow",
|
||||
"raw_string": "arrow"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103",
|
||||
"value": [
|
||||
{
|
||||
"string": "arrow",
|
||||
"raw_string": "arrow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
|
|
@ -1012,140 +878,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"Spiderman 2"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"Spiderman 2"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103",
|
||||
"value": [
|
||||
{
|
||||
"string": "arrow",
|
||||
"raw_string": "arrow"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103",
|
||||
"value": [
|
||||
{
|
||||
"string": "arrow",
|
||||
"raw_string": "arrow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
|
|
@ -1547,140 +1279,6 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"Spiderman 3"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"Spiderman 3"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103",
|
||||
"value": [
|
||||
{
|
||||
"string": "arrow",
|
||||
"raw_string": "arrow"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103",
|
||||
"value": [
|
||||
{
|
||||
"string": "arrow",
|
||||
"raw_string": "arrow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue