d2ir: More alex fixes
This commit is contained in:
parent
eed3f7eb21
commit
47d671209a
6 changed files with 1309 additions and 3 deletions
|
|
@ -410,6 +410,18 @@ func (c *compiler) compileMap(dst *Map, ast, scopeAST *d2ast.Map) {
|
|||
ScopeAST: scopeAST,
|
||||
})
|
||||
if !ok {
|
||||
// Unapply glob if appropriate.
|
||||
gctx := c.getGlobContext(c.mapRefContextStack[len(c.mapRefContextStack)-1])
|
||||
if gctx == nil {
|
||||
return
|
||||
}
|
||||
var ks string
|
||||
if gctx.refctx.Key.HasTripleGlob() {
|
||||
ks = d2format.Format(d2ast.MakeKeyPath(IDA(dst)))
|
||||
} else {
|
||||
ks = d2format.Format(d2ast.MakeKeyPath(BoardIDA(dst)))
|
||||
}
|
||||
delete(gctx.appliedFields, ks)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -896,14 +896,14 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, create b
|
|||
DueToLazyGlob_: c.lazyGlobBeingApplied,
|
||||
})
|
||||
}
|
||||
if !filter(f, true) {
|
||||
return nil
|
||||
}
|
||||
m.Fields = append(m.Fields, f)
|
||||
if i+1 == len(kp.Path) {
|
||||
faAppend(f)
|
||||
return nil
|
||||
}
|
||||
if !filter(f, true) {
|
||||
return nil
|
||||
}
|
||||
if f.Composite == nil {
|
||||
f.Composite = &Map{
|
||||
parent: f,
|
||||
|
|
|
|||
|
|
@ -150,6 +150,26 @@ x -> y
|
|||
assertQuery(t, m, 0, 0, 0.1, "(x -> y)[1].style.opacity")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "lazy-filter",
|
||||
run: func(t testing.TB) {
|
||||
m, err := compile(t, `
|
||||
*: {
|
||||
&label: a
|
||||
style.fill: yellow
|
||||
}
|
||||
|
||||
a
|
||||
# if i remove this line, the glob applies as expected
|
||||
b
|
||||
b.label: a
|
||||
`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 7, 0, nil, "")
|
||||
assertQuery(t, m, 0, 0, "yellow", "a.style.fill")
|
||||
assertQuery(t, m, 0, 0, "yellow", "b.style.fill")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
runa(t, tca)
|
||||
|
|
|
|||
|
|
@ -642,6 +642,30 @@ a -> b
|
|||
assertQuery(t, m, 0, 0, "hey", "(a -> b)[0].label")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "override/6",
|
||||
run: func(t testing.TB) {
|
||||
m, err := compile(t, `
|
||||
# Nulling glob doesn't work
|
||||
a
|
||||
*a.icon: https://icons.terrastruct.com/essentials%2F073-add.svg
|
||||
a.icon: null
|
||||
|
||||
# Regular icon nulling works
|
||||
b.icon: https://icons.terrastruct.com/essentials%2F073-add.svg
|
||||
b.icon: null
|
||||
|
||||
# Shape nulling works
|
||||
*.shape: circle
|
||||
a.shape: null
|
||||
b.shape: null
|
||||
`)
|
||||
assert.Success(t, err)
|
||||
assertQuery(t, m, 2, 0, nil, "")
|
||||
assertQuery(t, m, 0, 0, nil, "a")
|
||||
assertQuery(t, m, 0, 0, nil, "b")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "table-class-exception",
|
||||
run: func(t testing.TB) {
|
||||
|
|
|
|||
773
testdata/d2ir/TestCompile/filters/lazy-filter.exp.json
generated
vendored
Normal file
773
testdata/d2ir/TestCompile/filters/lazy-filter.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,773 @@
|
|||
{
|
||||
"fields": [
|
||||
{
|
||||
"name": "a",
|
||||
"composite": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "style",
|
||||
"composite": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "fill",
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:14:32-3:20:38",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:20:38",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:14:32-3:20:38",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": true,
|
||||
"due_to_lazy_glob": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:20:38",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:14:32-3:20:38",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": true,
|
||||
"due_to_lazy_glob": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,6:0:42-6:1:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,6:0:42-6:1:43",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,6:0:42-6:1:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,6:0:42-6:1:43",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,6:0:42-6:1:43",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,6:0:42-6:1:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "b",
|
||||
"composite": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "label",
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:9:109-9:10:110",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:2:102-9:7:107",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:7:107",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:1:101",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:2:102-9:7:107",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:10:110",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:7:107",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:1:101",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:2:102-9:7:107",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:9:109-9:10:110",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,2:3:9-2:8:14",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,2:3:9-2:8:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,2:3:9-2:8:14",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,2:2:8-2:11:17",
|
||||
"ampersand": true,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,2:3:9-2:8:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,2:3:9-2:8:14",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,2:10:16-2:11:17",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": true,
|
||||
"due_to_lazy_glob": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "style",
|
||||
"composite": {
|
||||
"fields": [
|
||||
{
|
||||
"name": "fill",
|
||||
"primary": {
|
||||
"value": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:14:32-3:20:38",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:20:38",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:14:32-3:20:38",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": true,
|
||||
"due_to_lazy_glob": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:20:38",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:12:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:2:20-3:7:25",
|
||||
"value": [
|
||||
{
|
||||
"string": "style",
|
||||
"raw_string": "style"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:8:26-3:12:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "fill",
|
||||
"raw_string": "fill"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,3:14:32-3:20:38",
|
||||
"value": [
|
||||
{
|
||||
"string": "yellow",
|
||||
"raw_string": "yellow"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": true,
|
||||
"due_to_lazy_glob": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,8:0:98-8:1:99",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,8:0:98-8:1:99",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,8:0:98-8:1:99",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,8:0:98-8:1:99",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,8:0:98-8:1:99",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,8:0:98-8:1:99",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:1:101",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:7:107",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:1:101",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:2:102-9:7:107",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:10:110",
|
||||
"key": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:7:107",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:0:100-9:1:101",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:2:102-9:7:107",
|
||||
"value": [
|
||||
{
|
||||
"string": "label",
|
||||
"raw_string": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/filters/lazy-filter.d2,9:9:109-9:10:110",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
}
|
||||
477
testdata/d2ir/TestCompile/patterns/override/6.exp.json
generated
vendored
Normal file
477
testdata/d2ir/TestCompile/patterns/override/6.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,477 @@
|
|||
{
|
||||
"fields": [
|
||||
{
|
||||
"name": "a",
|
||||
"composite": {
|
||||
"fields": [],
|
||||
"edges": null
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,2:0:29-2:1:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/override/6.d2,2:0:29-2:1:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,2:0:29-2:1:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,2:0:29-2:1:30",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,2:0:29-2:1:30",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,2:0:29-2:1:30",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:0:95-4:1:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:0:95-4:6:101",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:0:95-4:1:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:2:97-4:6:101",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:0:95-4:12:107",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:0:95-4:6:101",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:0:95-4:1:96",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:2:97-4:6:101",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"null": {
|
||||
"range": "TestCompile/patterns/override/6.d2,4:8:103-4:12:107"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:0:253-12:1:254",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:0:253-12:7:260",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:0:253-12:1:254",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:2:255-12:7:260",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:0:253-12:13:266",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:0:253-12:7:260",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:0:253-12:1:254",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:2:255-12:7:260",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"null": {
|
||||
"range": "TestCompile/patterns/override/6.d2,12:9:262-12:13:266"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "b",
|
||||
"composite": {
|
||||
"fields": [],
|
||||
"edges": null
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:0:138-7:1:139",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:0:138-7:6:144",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:0:138-7:1:139",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:2:140-7:6:144",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:0:138-7:62:200",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:0:138-7:6:144",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:0:138-7:1:139",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:2:140-7:6:144",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,7:8:146-7:62:200",
|
||||
"value": [
|
||||
{
|
||||
"string": "https://icons.terrastruct.com/essentials%2F073-add.svg",
|
||||
"raw_string": "https://icons.terrastruct.com/essentials%2F073-add.svg"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:0:201-8:1:202",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:0:201-8:6:207",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:0:201-8:1:202",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:2:203-8:6:207",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:0:201-8:12:213",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:0:201-8:6:207",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:0:201-8:1:202",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:2:203-8:6:207",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"null": {
|
||||
"range": "TestCompile/patterns/override/6.d2,8:8:209-8:12:213"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
},
|
||||
{
|
||||
"string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:0:267-13:1:268",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:0:267-13:7:274",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:0:267-13:1:268",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:2:269-13:7:274",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"edge": null,
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:0:267-13:13:280",
|
||||
"key": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:0:267-13:7:274",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:0:267-13:1:268",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:2:269-13:7:274",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"null": {
|
||||
"range": "TestCompile/patterns/override/6.d2,13:9:276-13:13:280"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"due_to_glob": false,
|
||||
"due_to_lazy_glob": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": null
|
||||
}
|
||||
Loading…
Reference in a new issue