diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index c1c7a6ecd..4ec0e1ba7 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,5 +1,7 @@ #### Features ๐Ÿš€ +- Glob inverse filters are implemented (e.g. `*: {!&shape: circle; style.fill: red}` to turn all non-circles red) [#2008](https://github.com/terrastruct/d2/pull/2008) + #### Improvements ๐Ÿงน - Opacity 0 shapes no longer have a label mask which made any segment of connections going through them lower opacity [#1940](https://github.com/terrastruct/d2/pull/1940) diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index 705e840ed..d11f9735f 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -660,6 +660,9 @@ func (mk1 *Key) D2OracleEquals(mk2 *Key) bool { if mk1.Ampersand != mk2.Ampersand { return false } + if mk1.NotAmpersand != mk2.NotAmpersand { + return false + } if (mk1.Key == nil) != (mk2.Key == nil) { return false } @@ -739,6 +742,9 @@ func (mk1 *Key) Equals(mk2 *Key) bool { if mk1.Ampersand != mk2.Ampersand { return false } + if mk1.NotAmpersand != mk2.NotAmpersand { + return false + } if (mk1.Key == nil) != (mk2.Key == nil) { return false } diff --git a/d2format/format.go b/d2format/format.go index dc7430ec2..dd1a42996 100644 --- a/d2format/format.go +++ b/d2format/format.go @@ -358,6 +358,9 @@ func (p *printer) _map(m *d2ast.Map) { func (p *printer) mapKey(mk *d2ast.Key) { if mk.Ampersand { p.sb.WriteByte('&') + } else if mk.NotAmpersand { + p.sb.WriteByte('!') + p.sb.WriteByte('&') } if mk.Key != nil { p.key(mk.Key) diff --git a/d2format/format_test.go b/d2format/format_test.go index c6dd79296..369361f2c 100644 --- a/d2format/format_test.go +++ b/d2format/format_test.go @@ -829,6 +829,30 @@ mybox: { mybox: { label: prefix${test}suffix } +`, + }, + { + name: "not-filter", + in: `jacob: { + shape: circle +} +jeremy: { + shape: rectangle +} +*: { + !&shape: rectangle + label: I'm not a rectangle +}`, + exp: `jacob: { + shape: circle +} +jeremy: { + shape: rectangle +} +*: { + !&shape: rectangle + label: I'm not a rectangle +} `, }, } diff --git a/d2ir/compile.go b/d2ir/compile.go index c119287cc..574acdb12 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -408,6 +408,9 @@ func (c *compiler) ampersandFilterMap(dst *Map, ast, scopeAST *d2ast.Map) bool { ScopeMap: dst, ScopeAST: scopeAST, }) + if n.MapKey.NotAmpersand { + ok = !ok + } if !ok { if len(c.mapRefContextStack) == 0 { return false @@ -591,7 +594,7 @@ func (c *compiler) compileKey(refctx *RefContext) { } func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) { - if refctx.Key.Ampersand { + if refctx.Key.Ampersand || refctx.Key.NotAmpersand { return } @@ -607,7 +610,7 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) } func (c *compiler) ampersandFilter(refctx *RefContext) bool { - if !refctx.Key.Ampersand { + if !refctx.Key.Ampersand && !refctx.Key.NotAmpersand { return true } if len(c.mapRefContextStack) == 0 || !c.mapRefContextStack[len(c.mapRefContextStack)-1].Key.SupportsGlobFilters() { diff --git a/d2ir/filter_test.go b/d2ir/filter_test.go index 06e926416..3ac569c53 100644 --- a/d2ir/filter_test.go +++ b/d2ir/filter_test.go @@ -225,6 +225,25 @@ classes: { assertQuery(t, m, 9, 3, nil, "") }, }, + { + name: "not-basic", + run: func(t testing.TB) { + m, err := compile(t, `jacob: { + shape: circle +} +jeremy: { + shape: rectangle +} +*: { + !&shape: rectangle + label: I'm not a rectangle +}`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "jacob") + assertQuery(t, m, 1, 0, nil, "jeremy") + assertQuery(t, m, 0, 0, "I'm not a rectangle", "jacob.label") + }, + }, } runa(t, tca) diff --git a/testdata/d2ir/TestCompile/filters/errors/not-basic.exp.json b/testdata/d2ir/TestCompile/filters/errors/not-basic.exp.json new file mode 100644 index 000000000..1bb4bd16d --- /dev/null +++ b/testdata/d2ir/TestCompile/filters/errors/not-basic.exp.json @@ -0,0 +1,653 @@ +{ + "fields": [ + { + "name": "jacob", + "composite": { + "fields": [ + { + "name": "shape", + "primary": { + "value": { + "range": "TestCompile/filters/errors/not-basic.d2,7:10:71-7:19:80", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:6:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:14:23", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:6:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,1:8:17-1:14:23", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + }, + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,7:1:62-7:19:80", + "not_ampersand": true, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:10:71-7:19:80", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + } + ] + }, + { + "name": "label", + "primary": { + "value": { + "range": "TestCompile/filters/errors/not-basic.d2,8:8:89-8:27:108", + "value": [ + { + "string": "I'm not a rectangle", + "raw_string": "I'm not a rectangle" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:27:108", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:8:89-8:27:108", + "value": [ + { + "string": "I'm not a rectangle", + "raw_string": "I'm not a rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "jacob", + "raw_string": "jacob" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,0:0:0-0:5:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "jacob", + "raw_string": "jacob" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,0:0:0-2:1:25", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,0:0:0-0:5:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "jacob", + "raw_string": "jacob" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/filters/errors/not-basic.d2,0:7:7-2:1:25", + "nodes": [ + { + "map_key": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:14:23", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:6:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,1:8:17-1:14:23", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + }, + { + "name": "jeremy", + "composite": { + "fields": [ + { + "name": "shape", + "primary": { + "value": { + "range": "TestCompile/filters/errors/not-basic.d2,7:10:71-7:19:80", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:6:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:17:53", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:6:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,4:8:44-4:17:53", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + }, + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,7:1:62-7:19:80", + "not_ampersand": true, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,7:10:71-7:19:80", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + } + ] + }, + { + "name": "label", + "primary": { + "value": { + "range": "TestCompile/filters/errors/not-basic.d2,8:8:89-8:27:108", + "value": [ + { + "string": "I'm not a rectangle", + "raw_string": "I'm not a rectangle" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:27:108", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,8:8:89-8:27:108", + "value": [ + { + "string": "I'm not a rectangle", + "raw_string": "I'm not a rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/errors/not-basic.d2,3:0:26-3:6:32", + "value": [ + { + "string": "jeremy", + "raw_string": "jeremy" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/errors/not-basic.d2,3:0:26-3:6:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,3:0:26-3:6:32", + "value": [ + { + "string": "jeremy", + "raw_string": "jeremy" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,3:0:26-5:1:55", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,3:0:26-3:6:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,3:0:26-3:6:32", + "value": [ + { + "string": "jeremy", + "raw_string": "jeremy" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/filters/errors/not-basic.d2,3:8:34-5:1:55", + "nodes": [ + { + "map_key": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:17:53", + "key": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:6:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/errors/not-basic.d2,4:8:44-4:17:53", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/filters/not-basic.exp.json b/testdata/d2ir/TestCompile/filters/not-basic.exp.json new file mode 100644 index 000000000..661fcd6b5 --- /dev/null +++ b/testdata/d2ir/TestCompile/filters/not-basic.exp.json @@ -0,0 +1,638 @@ +{ + "fields": [ + { + "name": "jacob", + "composite": { + "fields": [ + { + "name": "shape", + "primary": { + "value": { + "range": "TestCompile/filters/not-basic.d2,1:8:17-1:14:23", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:6:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:14:23", + "key": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:6:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,1:8:17-1:14:23", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + }, + { + "string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,7:1:62-7:19:80", + "not_ampersand": true, + "key": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:10:71-7:19:80", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + }, + { + "string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,7:1:62-7:19:80", + "not_ampersand": true, + "key": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:10:71-7:19:80", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + } + ] + }, + { + "name": "label", + "primary": { + "value": { + "range": "TestCompile/filters/not-basic.d2,8:8:89-8:27:108", + "value": [ + { + "string": "I'm not a rectangle", + "raw_string": "I'm not a rectangle" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,8:1:82-8:6:87", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,8:1:82-8:27:108", + "key": { + "range": "TestCompile/filters/not-basic.d2,8:1:82-8:6:87", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,8:1:82-8:6:87", + "value": [ + { + "string": "label", + "raw_string": "label" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,8:8:89-8:27:108", + "value": [ + { + "string": "I'm not a rectangle", + "raw_string": "I'm not a rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/not-basic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "jacob", + "raw_string": "jacob" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,0:0:0-0:5:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "jacob", + "raw_string": "jacob" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,0:0:0-2:1:25", + "key": { + "range": "TestCompile/filters/not-basic.d2,0:0:0-0:5:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,0:0:0-0:5:5", + "value": [ + { + "string": "jacob", + "raw_string": "jacob" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/filters/not-basic.d2,0:7:7-2:1:25", + "nodes": [ + { + "map_key": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:14:23", + "key": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:6:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,1:1:10-1:6:15", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,1:8:17-1:14:23", + "value": [ + { + "string": "circle", + "raw_string": "circle" + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + }, + { + "name": "jeremy", + "composite": { + "fields": [ + { + "name": "shape", + "primary": { + "value": { + "range": "TestCompile/filters/not-basic.d2,4:8:44-4:17:53", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:6:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:17:53", + "key": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:6:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,4:8:44-4:17:53", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + }, + { + "string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,7:1:62-7:19:80", + "not_ampersand": true, + "key": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:3:64-7:8:69", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,7:10:71-7:19:80", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + }, + "due_to_glob": true, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/not-basic.d2,3:0:26-3:6:32", + "value": [ + { + "string": "jeremy", + "raw_string": "jeremy" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/not-basic.d2,3:0:26-3:6:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,3:0:26-3:6:32", + "value": [ + { + "string": "jeremy", + "raw_string": "jeremy" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/not-basic.d2,3:0:26-5:1:55", + "key": { + "range": "TestCompile/filters/not-basic.d2,3:0:26-3:6:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,3:0:26-3:6:32", + "value": [ + { + "string": "jeremy", + "raw_string": "jeremy" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/filters/not-basic.d2,3:8:34-5:1:55", + "nodes": [ + { + "map_key": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:17:53", + "key": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:6:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,4:1:37-4:6:42", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/not-basic.d2,4:8:44-4:17:53", + "value": [ + { + "string": "rectangle", + "raw_string": "rectangle" + } + ] + } + } + } + } + ] + } + } + } + }, + "due_to_glob": false, + "due_to_lazy_glob": false + } + ] + } + ], + "edges": null +}