d2ir: Alixander review lazy glob fixes
This commit is contained in:
parent
507b2d622e
commit
89b400b8f1
8 changed files with 8740 additions and 158 deletions
|
|
@ -2745,6 +2745,7 @@ func TestCompile2(t *testing.T) {
|
|||
t.Run("seqdiagrams", testSeqDiagrams)
|
||||
t.Run("nulls", testNulls)
|
||||
t.Run("vars", testVars)
|
||||
t.Run("globs", testGlobs)
|
||||
}
|
||||
|
||||
func testBoards(t *testing.T) {
|
||||
|
|
@ -4032,6 +4033,48 @@ z: {
|
|||
})
|
||||
}
|
||||
|
||||
func testGlobs(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tca := []struct {
|
||||
name string
|
||||
skip bool
|
||||
run func(t *testing.T)
|
||||
}{
|
||||
{
|
||||
name: "alixander-lazy-globs-review",
|
||||
run: func(t *testing.T) {
|
||||
assertCompile(t, `
|
||||
***.style.fill: yellow
|
||||
**.shape: circle
|
||||
*.style.multiple: true
|
||||
|
||||
x: {
|
||||
y
|
||||
}
|
||||
|
||||
layers: {
|
||||
next: {
|
||||
a
|
||||
}
|
||||
}
|
||||
`, "")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tca {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
if tc.skip {
|
||||
t.SkipNow()
|
||||
}
|
||||
tc.run(t)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func assertCompile(t *testing.T, text string, expErr string) (*d2graph.Graph, *d2target.Config) {
|
||||
d2Path := fmt.Sprintf("d2/testdata/d2compiler/%v.d2", t.Name())
|
||||
g, config, err := d2compiler.Compile(d2Path, strings.NewReader(text), nil)
|
||||
|
|
|
|||
|
|
@ -574,7 +574,8 @@ func (rc *RefContext) EdgeIndex() int {
|
|||
}
|
||||
|
||||
func (rc *RefContext) Equal(rc2 *RefContext) bool {
|
||||
return rc.Edge == rc2.Edge && rc.Key.Equals(rc2.Key) && rc.Scope == rc2.Scope && rc.ScopeMap == rc2.ScopeMap && rc.ScopeAST == rc2.ScopeAST
|
||||
// We intentionally ignore edges here because the same glob can produce multiple RefContexts that should be treated the same with only the edge as the difference.
|
||||
return rc.Key.Equals(rc2.Key) && rc.Scope == rc2.Scope && rc.ScopeMap == rc2.ScopeMap && rc.ScopeAST == rc2.ScopeAST
|
||||
}
|
||||
|
||||
func (m *Map) FieldCountRecursive() int {
|
||||
|
|
@ -1000,7 +1001,7 @@ func (m *Map) CreateEdge(eid *EdgeID, refctx *RefContext, c *compiler) ([]*Edge,
|
|||
var ea []*Edge
|
||||
var gctx *globContext
|
||||
if refctx != nil && refctx.Key.HasGlob() && c != nil {
|
||||
gctx = c.getGlobContext(refctx)
|
||||
gctx = c.ensureGlobContext(refctx)
|
||||
}
|
||||
err := m.createEdge(eid, refctx, gctx, c, &ea)
|
||||
if err != nil {
|
||||
|
|
@ -1441,7 +1442,7 @@ func RelIDA(p, n Node) (ida []string) {
|
|||
case *Edge:
|
||||
ida = append(ida, n.String())
|
||||
}
|
||||
n = ParentField(n)
|
||||
n = n.Parent()
|
||||
f, fok := n.(*Field)
|
||||
e, eok := n.(*Edge)
|
||||
if n == nil || (fok && (f.Root() || f == p || f.Composite == p)) || (eok && (e == p || e.Map_ == p)) {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ func (m *Map) _tripleGlob(fa *[]*Field) {
|
|||
if _, ok := d2graph.BoardKeywords[f.Name]; !ok {
|
||||
continue
|
||||
}
|
||||
// We don't ever want to append layers, scenarios or steps directly.
|
||||
if f.Map() != nil {
|
||||
f.Map()._tripleGlob(fa)
|
||||
}
|
||||
continue
|
||||
}
|
||||
*fa = append(*fa, f)
|
||||
if f.Map() != nil {
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ scenarios.x: { p }
|
|||
layers.x: { p }
|
||||
`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 27, 0, nil, "")
|
||||
assertQuery(t, m, 25, 0, nil, "")
|
||||
assertQuery(t, m, 0, 0, "page", "a.shape")
|
||||
assertQuery(t, m, 0, 0, "page", "b.shape")
|
||||
assertQuery(t, m, 0, 0, "page", "c.shape")
|
||||
|
|
@ -413,6 +413,43 @@ layers.x: { j -> f }
|
|||
assertQuery(t, m, 0, 0, "diamond", "layers.x.(j -> f)[0].target-arrowhead.shape")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "alixander-review/1",
|
||||
run: func(t testing.TB) {
|
||||
m, err := compile(t, `
|
||||
***.style.fill: yellow
|
||||
**.shape: circle
|
||||
*.style.multiple: true
|
||||
|
||||
x: {
|
||||
y
|
||||
}
|
||||
|
||||
layers: {
|
||||
next: {
|
||||
a
|
||||
}
|
||||
}
|
||||
`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 16, 0, nil, "")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "alixander-review/2",
|
||||
run: func(t testing.TB) {
|
||||
m, err := compile(t, `
|
||||
a
|
||||
|
||||
* -> y
|
||||
|
||||
b
|
||||
c
|
||||
`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 4, 3, nil, "")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
runa(t, tca)
|
||||
|
|
|
|||
674
testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.exp.json
generated
vendored
Normal file
674
testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,674 @@
|
|||
{
|
||||
"graph": {
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,0:0:0-14:0:109",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:0:1-1:22:23",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:0:1-1:14:15",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:0:1-1:3:4",
|
||||
"value": [
|
||||
{
|
||||
"string": "***",
|
||||
"raw_string": "***"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*",
|
||||
"",
|
||||
"*",
|
||||
"",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:4:5-1:9:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:10:11-1:14:15",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:16:17-1:22:23",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,2:0:24-2:16:40",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,2:0:24-2:8:32",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,2:0:24-2:2:26",
|
||||
"value": [
|
||||
{
|
||||
"string": "**",
|
||||
"raw_string": "**"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*",
|
||||
"",
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,2:3:27-2:8:32",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,2:10:34-2:16:40",
|
||||
"value": [
|
||||
{
|
||||
"string": "circle",
|
||||
"raw_string": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,3:0:41-3:22:63",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,3:0:41-3:16:57",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,3:0:41-3:1:42",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,3:2:43-3:7:48",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,3:8:49-3:16:57",
|
||||
"value": [
|
||||
{
|
||||
"string": "multiple",
|
||||
"raw_string": "multiple"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"boolean": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,3:18:59-3:22:63",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,5:0:65-7:1:75",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,5:0:65-5:1:66",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,5:0:65-5:1:66",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,5:3:68-7:1:75",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,6:2:72-6:3:73",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,6:2:72-6:3:73",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,6:2:72-6:3:73",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,9:0:77-13:1:108",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,9:0:77-9:6:83",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,9:0:77-9:6:83",
|
||||
"value": [
|
||||
{
|
||||
"string": "layers",
|
||||
"raw_string": "layers"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,9:8:85-13:1:108",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,10:2:89-12:3:106",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,10:2:89-10:6:93",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,10:2:89-10:6:93",
|
||||
"value": [
|
||||
{
|
||||
"string": "next",
|
||||
"raw_string": "next"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,10:8:95-12:3:106",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,11:4:101-11:5:102",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,11:4:101-11:5:102",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,11:4:101-11:5:102",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"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/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,5:0:65-5:1:66",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,5:0:65-5:1:66",
|
||||
"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": {
|
||||
"fill": {
|
||||
"value": "yellow"
|
||||
},
|
||||
"multiple": {
|
||||
"value": "true"
|
||||
}
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": null
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "y",
|
||||
"id_val": "y",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,6:2:72-6:3:73",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,6:2:72-6:3:73",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "y"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {
|
||||
"fill": {
|
||||
"value": "yellow"
|
||||
}
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": null
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
],
|
||||
"layers": [
|
||||
{
|
||||
"name": "next",
|
||||
"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": "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": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:16:17-1:22:23",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"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": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,1:16:17-1:22:23",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {
|
||||
"fill": {
|
||||
"value": "yellow"
|
||||
}
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": null
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"id": "a",
|
||||
"id_val": "a",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,11:4:101-11:5:102",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2compiler/TestCompile2/globs/alixander-lazy-globs-review.d2,11:4:101-11:5:102",
|
||||
"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": {
|
||||
"fill": {
|
||||
"value": "yellow"
|
||||
}
|
||||
},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": null
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": null
|
||||
}
|
||||
7128
testdata/d2ir/TestCompile/patterns/alixander-review/1.exp.json
generated
vendored
Normal file
7128
testdata/d2ir/TestCompile/patterns/alixander-review/1.exp.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
848
testdata/d2ir/TestCompile/patterns/alixander-review/2.exp.json
generated
vendored
Normal file
848
testdata/d2ir/TestCompile/patterns/alixander-review/2.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,848 @@
|
|||
{
|
||||
"fields": [
|
||||
{
|
||||
"name": "a",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,1:0:1-1:1:2",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,1:0:1-1:1:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,1:0:1-1:1:2",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,1:0:1-1:1:2",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,1:0:1-1:1:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,1:0:1-1:1:2",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "y",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "b",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,5:0:12-5:1:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,5:0:12-5:1:13",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,5:0:12-5:1:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,5:0:12-5:1:13",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,5:0:12-5:1:13",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,5:0:12-5:1:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "c",
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,6:0:14-6:1:15",
|
||||
"value": [
|
||||
{
|
||||
"string": "c",
|
||||
"raw_string": "c"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,6:0:14-6:1:15",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,6:0:14-6:1:15",
|
||||
"value": [
|
||||
{
|
||||
"string": "c",
|
||||
"raw_string": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,6:0:14-6:1:15",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,6:0:14-6:1:15",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,6:0:14-6:1:15",
|
||||
"value": [
|
||||
{
|
||||
"string": "c",
|
||||
"raw_string": "c"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"a"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"y"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"b"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"y"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"edge_id": {
|
||||
"src_path": [
|
||||
"c"
|
||||
],
|
||||
"src_arrow": false,
|
||||
"dst_path": [
|
||||
"y"
|
||||
],
|
||||
"dst_arrow": true,
|
||||
"index": 0,
|
||||
"glob": false
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"context": {
|
||||
"edge": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
},
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:6:10",
|
||||
"src": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:0:4-3:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "*",
|
||||
"raw_string": "*"
|
||||
}
|
||||
],
|
||||
"pattern": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/alixander-review/2.d2,3:5:9-3:6:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
154
testdata/d2ir/TestCompile/patterns/triple-glob/defaults.exp.json
generated
vendored
154
testdata/d2ir/TestCompile/patterns/triple-glob/defaults.exp.json
generated
vendored
|
|
@ -2168,83 +2168,6 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "shape",
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:8:15-1:12:19",
|
||||
"value": [
|
||||
{
|
||||
"string": "page",
|
||||
"raw_string": "page"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:12:19",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:8:15-1:12:19",
|
||||
"value": [
|
||||
{
|
||||
"string": "page",
|
||||
"raw_string": "page"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
|
|
@ -3036,83 +2959,6 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "shape",
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:8:15-1:12:19",
|
||||
"value": [
|
||||
{
|
||||
"string": "page",
|
||||
"raw_string": "page"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:12:19",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:1:8-1:6:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/triple-glob/defaults.d2,1:8:15-1:12:19",
|
||||
"value": [
|
||||
{
|
||||
"string": "page",
|
||||
"raw_string": "page"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
|
|
|
|||
Loading…
Reference in a new issue