From 317964af6bdaaf845ea68e24674fcf9077f8a45e Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Thu, 17 Aug 2023 14:42:52 -0700 Subject: [PATCH] d2ir: Add exception for &label filter --- d2ast/d2ast.go | 4 + d2ir/compile.go | 26 +- d2ir/filter_test.go | 25 + .../TestCompile/filters/id-filter.exp.json | 1246 +++++++++++++++++ 4 files changed, 1300 insertions(+), 1 deletion(-) create mode 100644 testdata/d2ir/TestCompile/filters/id-filter.exp.json diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index 41e974c5e3..133bbbf7f7 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -801,6 +801,10 @@ func (kp *KeyPath) Copy() *KeyPath { return &kp2 } +func (kp *KeyPath) Last() *StringBox { + return kp.Path[len(kp.Path)-1] +} + func IsDoubleGlob(pattern []string) bool { return len(pattern) == 3 && pattern[0] == "*" && pattern[1] == "" && pattern[2] == "*" } diff --git a/d2ir/compile.go b/d2ir/compile.go index 0d5b985574..60ffa68efe 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -414,6 +414,7 @@ func (c *compiler) compileMap(dst *Map, ast, scopeAST *d2ast.Map) { } } } + for _, n := range ast.Nodes { switch { case n.MapKey != nil: @@ -554,7 +555,30 @@ func (c *compiler) ampersandFilter(refctx *RefContext) bool { return false } if len(fa) == 0 { - return false + if refctx.Key.Key.Last().ScalarString() != "label" { + return false + } + kp := refctx.Key.Key.Copy() + kp.Path = kp.Path[:len(kp.Path)-1] + if len(kp.Path) == 0 { + fa = append(fa, ParentField(refctx.ScopeMap)) + } else { + fa, err = refctx.ScopeMap.EnsureField(kp, refctx, false, c) + if err != nil { + c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) + return false + } + } + for _, f := range fa { + label := f.Name + if f.Primary_ != nil { + label = f.Primary_.Value.ScalarString() + } + if label != refctx.Key.Value.ScalarBox().Unbox().ScalarString() { + return false + } + } + return true } for _, f := range fa { ok := c._ampersandFilter(f, refctx) diff --git a/d2ir/filter_test.go b/d2ir/filter_test.go index 710ba08034..e7c0b014e9 100644 --- a/d2ir/filter_test.go +++ b/d2ir/filter_test.go @@ -96,6 +96,31 @@ x -> y assertQuery(t, m, 0, 0, nil, "(x -> y)[1]") }, }, + { + name: "id-filter", + run: func(t testing.TB) { + m, err := compile(t, ` +x +y +p: p + +*.style.opacity: 0.1 +*: { + &label: x + style.opacity: 1 +} +*: { + &label: p + style.opacity: 0.5 +} +`) + assert.Success(t, err) + assertQuery(t, m, 9, 0, nil, "") + assertQuery(t, m, 0, 0, 1, "x.style.opacity") + assertQuery(t, m, 0, 0, 0.1, "y.style.opacity") + assertQuery(t, m, 0, 0, 0.5, "p.style.opacity") + }, + }, } runa(t, tca) diff --git a/testdata/d2ir/TestCompile/filters/id-filter.exp.json b/testdata/d2ir/TestCompile/filters/id-filter.exp.json new file mode 100644 index 0000000000..9a19ec594c --- /dev/null +++ b/testdata/d2ir/TestCompile/filters/id-filter.exp.json @@ -0,0 +1,1246 @@ +{ + "fields": [ + { + "name": "x", + "composite": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "opacity", + "primary": { + "value": { + "range": "TestCompile/filters/id-filter.d2,8:17:66-8:18:67", + "raw": "1", + "value": "1" + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:20:31", + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,5:17:28-5:20:31", + "raw": "0.1", + "value": "1/10" + } + } + } + }, + "from_glob": true + }, + { + "string": { + "range": "TestCompile/filters/id-filter.d2,8:8:57-8:15:64", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:15:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:7:56", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:8:57-8:15:64", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:18:67", + "key": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:15:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:7:56", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:8:57-8:15:64", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,8:17:66-8:18:67", + "raw": "1", + "value": "1" + } + } + } + }, + "from_glob": true + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:20:31", + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,5:17:28-5:20:31", + "raw": "0.1", + "value": "1/10" + } + } + } + }, + "from_glob": true + }, + { + "string": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:7:56", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:15:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:7:56", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:8:57-8:15:64", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:18:67", + "key": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:15:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:2:51-8:7:56", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,8:8:57-8:15:64", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,8:17:66-8:18:67", + "raw": "1", + "value": "1" + } + } + } + }, + "from_glob": true + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,1:0:1-1:1:2", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,1:0:1-1:1:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,1:0:1-1:1:2", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,1:0:1-1:1:2", + "key": { + "range": "TestCompile/filters/id-filter.d2,1:0:1-1:1:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,1:0:1-1:1:2", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + "from_glob": false + } + ] + }, + { + "name": "y", + "composite": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "opacity", + "primary": { + "value": { + "range": "TestCompile/filters/id-filter.d2,5:17:28-5:20:31", + "raw": "0.1", + "value": "1/10" + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:20:31", + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,5:17:28-5:20:31", + "raw": "0.1", + "value": "1/10" + } + } + } + }, + "from_glob": true + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:20:31", + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,5:17:28-5:20:31", + "raw": "0.1", + "value": "1/10" + } + } + } + }, + "from_glob": true + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,2:0:3-2:1:4", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,2:0:3-2:1:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,2:0:3-2:1:4", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,2:0:3-2:1:4", + "key": { + "range": "TestCompile/filters/id-filter.d2,2:0:3-2:1:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,2:0:3-2:1:4", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + "from_glob": false + } + ] + }, + { + "name": "p", + "primary": { + "value": { + "range": "TestCompile/filters/id-filter.d2,3:3:8-3:4:9", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + }, + "composite": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "opacity", + "primary": { + "value": { + "range": "TestCompile/filters/id-filter.d2,12:17:104-12:20:107", + "raw": "0.5", + "value": "1/2" + } + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:20:31", + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,5:17:28-5:20:31", + "raw": "0.1", + "value": "1/10" + } + } + } + }, + "from_glob": true + }, + { + "string": { + "range": "TestCompile/filters/id-filter.d2,12:8:95-12:15:102", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:15:102", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:7:94", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:8:95-12:15:102", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:20:107", + "key": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:15:102", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:7:94", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:8:95-12:15:102", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,12:17:104-12:20:107", + "raw": "0.5", + "value": "1/2" + } + } + } + }, + "from_glob": true + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:20:31", + "key": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:15:26", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:0:11-5:1:12", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:2:13-5:7:18", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,5:8:19-5:15:26", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,5:17:28-5:20:31", + "raw": "0.1", + "value": "1/10" + } + } + } + }, + "from_glob": true + }, + { + "string": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:7:94", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:15:102", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:7:94", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:8:95-12:15:102", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:20:107", + "key": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:15:102", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:2:89-12:7:94", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,12:8:95-12:15:102", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "number": { + "range": "TestCompile/filters/id-filter.d2,12:17:104-12:20:107", + "raw": "0.5", + "value": "1/2" + } + } + } + }, + "from_glob": true + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/filters/id-filter.d2,3:0:5-3:1:6", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + }, + "key_path": { + "range": "TestCompile/filters/id-filter.d2,3:0:5-3:1:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,3:0:5-3:1:6", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/filters/id-filter.d2,3:0:5-3:4:9", + "key": { + "range": "TestCompile/filters/id-filter.d2,3:0:5-3:1:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,3:0:5-3:1:6", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/filters/id-filter.d2,3:3:8-3:4:9", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + } + }, + "from_glob": false + } + ] + } + ], + "edges": null +}