diff --git a/d2ir/compile_test.go b/d2ir/compile_test.go index f29b45c275..61b1f49a62 100644 --- a/d2ir/compile_test.go +++ b/d2ir/compile_test.go @@ -85,23 +85,27 @@ func assertQuery(t testing.TB, n d2ir.Node, nfields, nedges int, primary interfa m := n.Map() p := n.Primary() + var na []d2ir.Node if idStr != "" { var err error - n, err = m.Query(idStr) + na, err = m.QueryAll(idStr) assert.Success(t, err) assert.NotEqual(t, n, nil) - - p = n.Primary() - m = n.Map() + } else { + na = append(na, n) } - assert.Equal(t, nfields, m.FieldCountRecursive()) - assert.Equal(t, nedges, m.EdgeCountRecursive()) - if !makeScalar(p).Equal(makeScalar(primary)) { - t.Fatalf("expected primary %#v but got %s", primary, p) + for _, n := range na { + m = n.Map() + p = n.Primary() + assert.Equal(t, nfields, m.FieldCountRecursive()) + assert.Equal(t, nedges, m.EdgeCountRecursive()) + if !makeScalar(p).Equal(makeScalar(primary)) { + t.Fatalf("expected primary %#v but got %s", primary, p) + } } - return n + return na[0] } func makeScalar(v interface{}) *d2ir.Scalar { diff --git a/d2ir/pattern.go b/d2ir/pattern.go index c2ccf237c3..8118fb1130 100644 --- a/d2ir/pattern.go +++ b/d2ir/pattern.go @@ -31,6 +31,9 @@ func matchPattern(s string, pattern []string) bool { if len(pattern) == 0 { return true } + if _, ok := d2graph.ReservedKeywords[s]; ok { + return false + } for i := 0; i < len(pattern); i++ { if pattern[i] == "*" { diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index ff91934d82..cfecbb7e15 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -193,6 +193,25 @@ shared.animal assertQuery(t, m, 1, 0, nil, "shared.animal.style") }, }, + { + name: "reserved", + run: func(t testing.TB) { + m, err := compile(t, `vars: { + d2-config: { + layout-engine: elk + } +} + +Spiderman 1 +Spiderman 2 +Spiderman 3 + +* -> *: arrow`) + assert.Success(t, err) + assertQuery(t, m, 6, 9, nil, "") + assertQuery(t, m, 0, 0, "arrow", "(* -> *)[*]") + }, + }, } runa(t, tca) diff --git a/d2ir/query.go b/d2ir/query.go index 0f7caddc9f..8534d53e57 100644 --- a/d2ir/query.go +++ b/d2ir/query.go @@ -29,8 +29,14 @@ func (m *Map) QueryAll(idStr string) (na []Node, _ error) { } eida := NewEdgeIDs(k) - for _, eid := range eida { - ea := m.GetEdges(eid, nil) + + for i, eid := range eida { + refctx := &RefContext{ + Key: k, + ScopeMap: m, + Edge: k.Edges[i], + } + ea := m.GetEdges(eid, refctx) for _, e := range ea { if k.EdgeKey == nil { na = append(na, e) diff --git a/testdata/d2ir/TestCompile/patterns/reserved.exp.json b/testdata/d2ir/TestCompile/patterns/reserved.exp.json new file mode 100644 index 0000000000..091efd0dfe --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/reserved.exp.json @@ -0,0 +1,1686 @@ +{ + "fields": [ + { + "name": "vars", + "composite": { + "fields": [ + { + "name": "d2-config", + "composite": { + "fields": [ + { + "name": "layout-engine", + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:22:45", + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-3:3:49", + "key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/reserved.d2,1:13:21-3:3:49", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:22:45", + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + } + } + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-4:1:51", + "key": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/reserved.d2,0:6:6-4:1:51", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-3:3:49", + "key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/reserved.d2,1:13:21-3:3:49", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:22:45", + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + } + ] + }, + { + "name": "Spiderman 1", + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "value": [ + { + "string": "Spiderman 1", + "raw_string": "Spiderman 1" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "value": [ + { + "string": "Spiderman 1", + "raw_string": "Spiderman 1" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "key": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "value": [ + { + "string": "Spiderman 1", + "raw_string": "Spiderman 1" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "Spiderman 2", + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "value": [ + { + "string": "Spiderman 2", + "raw_string": "Spiderman 2" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "value": [ + { + "string": "Spiderman 2", + "raw_string": "Spiderman 2" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "key": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "value": [ + { + "string": "Spiderman 2", + "raw_string": "Spiderman 2" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "Spiderman 3", + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "value": [ + { + "string": "Spiderman 3", + "raw_string": "Spiderman 3" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "value": [ + { + "string": "Spiderman 3", + "raw_string": "Spiderman 3" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "key": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "value": [ + { + "string": "Spiderman 3", + "raw_string": "Spiderman 3" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "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": [ + "Spiderman 1" + ], + "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": [ + "Spiderman 1" + ], + "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" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 2" + ], + "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": [ + "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": [ + "Spiderman 2" + ], + "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" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 3" + ], + "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": [ + "Spiderman 3" + ], + "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": [ + "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" + } + ] + } + } + } + } + } + ] + } + ] +}