From 359976e5d4e8a3f6724e0a9db3faf2742a593f8d Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Fri, 23 Jun 2023 10:51:55 -0700 Subject: [PATCH 01/15] d2ir: Add single level field glob patterns --- d2ast/d2ast.go | 6 + d2ir/compile.go | 19 ++ d2ir/compile_test.go | 1 + d2ir/pattern.go | 31 +++ d2ir/pattern_test.go | 94 +++++++ d2parser/parse.go | 25 +- .../d2ir/TestCompile/globs/escaped.exp.json | 159 ++++++++++++ .../d2ir/TestCompile/globs/prefix.exp.json | 159 ++++++++++++ .../TestCompile/patterns/escaped.exp.json | 236 ++++++++++++++++++ .../patterns/prefix-suffix.exp.json | 159 ++++++++++++ .../patterns/prefix-suffix/2.exp.json | 159 ++++++++++++ .../patterns/prefix-suffix/3.exp.json | 159 ++++++++++++ .../d2ir/TestCompile/patterns/prefix.exp.json | 159 ++++++++++++ .../d2ir/TestCompile/patterns/suffix.exp.json | 159 ++++++++++++ 14 files changed, 1514 insertions(+), 11 deletions(-) create mode 100644 d2ir/pattern.go create mode 100644 d2ir/pattern_test.go create mode 100644 testdata/d2ir/TestCompile/globs/escaped.exp.json create mode 100644 testdata/d2ir/TestCompile/globs/prefix.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/escaped.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/prefix-suffix.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/prefix-suffix/2.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/prefix-suffix/3.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/prefix.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/suffix.exp.json diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index 6313dbe0d..629612c22 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -500,6 +500,8 @@ type Number struct { type UnquotedString struct { Range Range `json:"range"` Value []InterpolationBox `json:"value"` + // Pattern holds the parsed glob pattern if in a key and the unquoted string represents a valid pattern. + Pattern []string `json:"pattern,omitempty"` } func (s *UnquotedString) Coalesce() { @@ -1056,6 +1058,10 @@ func (sb *StringBox) Unbox() String { } } +func (sb *StringBox) ScalarString() string { + return sb.Unbox().ScalarString() +} + // InterpolationBox is used to select between strings and substitutions in unquoted and // double quoted strings. There is no corresponding interface to avoid unnecessary // abstraction. diff --git a/d2ir/compile.go b/d2ir/compile.go index 66eb97818..f8e0ff67c 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -404,12 +404,31 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) return } } + + us, ok := kp.Path[0].Unbox().(*d2ast.UnquotedString) + if ok && us.Pattern != nil { + for _, f := range dst.Fields { + if matchPattern(f.Name, us.Pattern) { + if len(kp.Path) == 1 { + c._compileField(f, refctx) + } else { + // TODO: recurse + } + } + } + return + } + f, err := dst.EnsureField(kp, refctx) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) return } + c._compileField(f, refctx) +} + +func (c *compiler) _compileField(f *Field, refctx *RefContext) { if refctx.Key.Primary.Unbox() != nil { f.Primary_ = &Scalar{ parent: f, diff --git a/d2ir/compile_test.go b/d2ir/compile_test.go index ab7173c8e..f29b45c27 100644 --- a/d2ir/compile_test.go +++ b/d2ir/compile_test.go @@ -26,6 +26,7 @@ func TestCompile(t *testing.T) { t.Run("scenarios", testCompileScenarios) t.Run("steps", testCompileSteps) t.Run("imports", testCompileImports) + t.Run("patterns", testCompilePatterns) } type testCase struct { diff --git a/d2ir/pattern.go b/d2ir/pattern.go new file mode 100644 index 000000000..39fd5c397 --- /dev/null +++ b/d2ir/pattern.go @@ -0,0 +1,31 @@ +package d2ir + +import ( + "strings" +) + +func matchPattern(s string, pattern []string) bool { + if len(pattern) == 0 { + return true + } + + for i := 0; i < len(pattern); i++ { + if pattern[i] == "*" { + // * so match next. + if i != len(pattern)-1 { + j := strings.Index(s, pattern[i+1]) + if j == -1 { + return false + } + s = s[j+len(pattern[i+1]):] + i++ + } + } else { + if !strings.HasPrefix(s, pattern[i]) { + return false + } + s = s[len(pattern[i]):] + } + } + return true +} diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go new file mode 100644 index 000000000..b1709080d --- /dev/null +++ b/d2ir/pattern_test.go @@ -0,0 +1,94 @@ +package d2ir_test + +import ( + "testing" + + "oss.terrastruct.com/util-go/assert" +) + +func testCompilePatterns(t *testing.T) { + t.Parallel() + + tca := []testCase{ + { + name: "prefix", + run: func(t testing.TB) { + m, err := compile(t, `animal: meow +action: yes +a*: globbed`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "") + assertQuery(t, m, 0, 0, "globbed", "animal") + assertQuery(t, m, 0, 0, "globbed", "action") + }, + }, + { + name: "suffix", + run: func(t testing.TB) { + m, err := compile(t, `animal: meow +jingle: loud +*l: globbed`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "") + assertQuery(t, m, 0, 0, "globbed", "animal") + assertQuery(t, m, 0, 0, "globbed", "jingle") + }, + }, + { + name: "prefix-suffix", + run: func(t testing.TB) { + m, err := compile(t, `tinker: meow +thinker: yes +t*r: globbed`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "") + assertQuery(t, m, 0, 0, "globbed", "tinker") + assertQuery(t, m, 0, 0, "globbed", "thinker") + }, + }, + { + name: "prefix-suffix/2", + run: func(t testing.TB) { + m, err := compile(t, `tinker: meow +thinker: yes +t*ink*r: globbed`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "") + assertQuery(t, m, 0, 0, "globbed", "tinker") + assertQuery(t, m, 0, 0, "globbed", "thinker") + }, + }, + { + name: "prefix-suffix/3", + run: func(t testing.TB) { + m, err := compile(t, `tinkertinker: meow +thinkerthinker: yes +t*ink*r*t*inke*: globbed`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "") + assertQuery(t, m, 0, 0, "globbed", "tinkertinker") + assertQuery(t, m, 0, 0, "globbed", "thinkerthinker") + }, + }, + { + name: "escaped", + run: func(t testing.TB) { + m, err := compile(t, `animal: meow +action: yes +a\*: globbed`) + assert.Success(t, err) + assertQuery(t, m, 3, 0, nil, "") + assertQuery(t, m, 0, 0, "meow", "animal") + assertQuery(t, m, 0, 0, "yes", "action") + assertQuery(t, m, 0, 0, "globbed", `a\*`) + }, + }, + } + + runa(t, tca) + + t.Run("errors", func(t *testing.T) { + tca := []testCase{} + runa(t, tca) + }) +} diff --git a/d2parser/parse.go b/d2parser/parse.go index bb460da82..d7a540897 100644 --- a/d2parser/parse.go +++ b/d2parser/parse.go @@ -1046,6 +1046,15 @@ func (p *parser) parseUnquotedString(inKey bool) (s *d2ast.UnquotedString) { s.Value = append(s.Value, d2ast.InterpolationBox{String: &sv, StringRaw: &rawv}) }() + lastPatternIndex := 0 + defer func() { + if s.Pattern != nil { + if lastPatternIndex < sb.Len() { + s.Pattern = append(s.Pattern, sb.String()[lastPatternIndex:]) + } + } + }() + _s, eof := p.peekn(4) p.rewind() if !eof { @@ -1118,18 +1127,12 @@ func (p *parser) parseUnquotedString(inKey bool) (s *d2ast.UnquotedString) { rawb.WriteRune(r) r = r2 case '*': - // TODO: need a peekNotSpace across escaped newlines - r2, eof := p.peek() - if eof { - return s + if sb.Len() == 0 { + s.Pattern = append(s.Pattern, "*") + } else { + s.Pattern = append(s.Pattern, sb.String()[lastPatternIndex:], "*") } - if r2 == '-' { - p.rewind() - return s - } - sb.WriteRune(r) - rawb.WriteRune(r) - r = r2 + lastPatternIndex = len(sb.String()) + 1 } } diff --git a/testdata/d2ir/TestCompile/globs/escaped.exp.json b/testdata/d2ir/TestCompile/globs/escaped.exp.json new file mode 100644 index 000000000..de7e12d68 --- /dev/null +++ b/testdata/d2ir/TestCompile/globs/escaped.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "animal", + "primary": { + "value": { + "range": "TestCompile/globs/escaped.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/globs/escaped.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/globs/escaped.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/escaped.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/globs/escaped.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/globs/escaped.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/escaped.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/globs/escaped.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "action", + "primary": { + "value": { + "range": "TestCompile/globs/escaped.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/globs/escaped.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + }, + "key_path": { + "range": "TestCompile/globs/escaped.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/escaped.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/globs/escaped.d2,1:0:13-1:11:24", + "key": { + "range": "TestCompile/globs/escaped.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/escaped.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/globs/escaped.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/globs/prefix.exp.json b/testdata/d2ir/TestCompile/globs/prefix.exp.json new file mode 100644 index 000000000..7c50c6809 --- /dev/null +++ b/testdata/d2ir/TestCompile/globs/prefix.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "animal", + "primary": { + "value": { + "range": "TestCompile/globs/prefix.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/globs/prefix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/globs/prefix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/prefix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/globs/prefix.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/globs/prefix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/prefix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/globs/prefix.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "action", + "primary": { + "value": { + "range": "TestCompile/globs/prefix.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/globs/prefix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + }, + "key_path": { + "range": "TestCompile/globs/prefix.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/prefix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/globs/prefix.d2,1:0:13-1:11:24", + "key": { + "range": "TestCompile/globs/prefix.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/globs/prefix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/globs/prefix.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/escaped.exp.json b/testdata/d2ir/TestCompile/patterns/escaped.exp.json new file mode 100644 index 000000000..27262dd30 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/escaped.exp.json @@ -0,0 +1,236 @@ +{ + "fields": [ + { + "name": "animal", + "primary": { + "value": { + "range": "TestCompile/patterns/escaped.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/escaped.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/escaped.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/escaped.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/patterns/escaped.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "action", + "primary": { + "value": { + "range": "TestCompile/patterns/escaped.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/escaped.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/escaped.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/escaped.d2,1:0:13-1:11:24", + "key": { + "range": "TestCompile/patterns/escaped.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + }, + { + "name": "a*", + "primary": { + "value": { + "range": "TestCompile/patterns/escaped.d2,2:5:30-2:12:37", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/escaped.d2,2:0:25-2:2:27", + "value": [ + { + "string": "a*", + "raw_string": "a\\*" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/escaped.d2,2:0:25-2:2:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,2:0:25-2:2:27", + "value": [ + { + "string": "a*", + "raw_string": "a\\*" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/escaped.d2,2:0:25-2:12:37", + "key": { + "range": "TestCompile/patterns/escaped.d2,2:0:25-2:2:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,2:0:25-2:2:27", + "value": [ + { + "string": "a*", + "raw_string": "a\\*" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/escaped.d2,2:5:30-2:12:37", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/prefix-suffix.exp.json b/testdata/d2ir/TestCompile/patterns/prefix-suffix.exp.json new file mode 100644 index 000000000..a71fb970b --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/prefix-suffix.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "tinker", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix-suffix.d2,2:5:31-2:12:38", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix-suffix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "tinker", + "raw_string": "tinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix-suffix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "tinker", + "raw_string": "tinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix-suffix.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/patterns/prefix-suffix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "tinker", + "raw_string": "tinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "thinker", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix-suffix.d2,2:5:31-2:12:38", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix-suffix.d2,1:0:13-1:7:20", + "value": [ + { + "string": "thinker", + "raw_string": "thinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix-suffix.d2,1:0:13-1:7:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix.d2,1:0:13-1:7:20", + "value": [ + { + "string": "thinker", + "raw_string": "thinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix-suffix.d2,1:0:13-1:12:25", + "key": { + "range": "TestCompile/patterns/prefix-suffix.d2,1:0:13-1:7:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix.d2,1:0:13-1:7:20", + "value": [ + { + "string": "thinker", + "raw_string": "thinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix.d2,1:9:22-1:12:25", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/prefix-suffix/2.exp.json b/testdata/d2ir/TestCompile/patterns/prefix-suffix/2.exp.json new file mode 100644 index 000000000..175299dad --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/prefix-suffix/2.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "tinker", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,2:9:35-2:16:42", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "tinker", + "raw_string": "tinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "tinker", + "raw_string": "tinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "tinker", + "raw_string": "tinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "thinker", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,2:9:35-2:16:42", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,1:0:13-1:7:20", + "value": [ + { + "string": "thinker", + "raw_string": "thinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,1:0:13-1:7:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,1:0:13-1:7:20", + "value": [ + { + "string": "thinker", + "raw_string": "thinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,1:0:13-1:12:25", + "key": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,1:0:13-1:7:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,1:0:13-1:7:20", + "value": [ + { + "string": "thinker", + "raw_string": "thinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/2.d2,1:9:22-1:12:25", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/prefix-suffix/3.exp.json b/testdata/d2ir/TestCompile/patterns/prefix-suffix/3.exp.json new file mode 100644 index 000000000..1504168b9 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/prefix-suffix/3.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "tinkertinker", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,2:17:56-2:24:63", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,0:0:0-0:12:12", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,0:0:0-0:12:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,0:0:0-0:12:12", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,0:0:0-0:18:18", + "key": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,0:0:0-0:12:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,0:0:0-0:12:12", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,0:14:14-0:18:18", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "thinkerthinker", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,2:17:56-2:24:63", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,1:0:19-1:14:33", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,1:0:19-1:14:33", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,1:0:19-1:14:33", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,1:0:19-1:19:38", + "key": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,1:0:19-1:14:33", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,1:0:19-1:14:33", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix-suffix/3.d2,1:16:35-1:19:38", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/prefix.exp.json b/testdata/d2ir/TestCompile/patterns/prefix.exp.json new file mode 100644 index 000000000..62dec6cc3 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/prefix.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "animal", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix.d2,2:4:29-2:11:36", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/patterns/prefix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "action", + "primary": { + "value": { + "range": "TestCompile/patterns/prefix.d2,2:4:29-2:11:36", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/prefix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/prefix.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/prefix.d2,1:0:13-1:11:24", + "key": { + "range": "TestCompile/patterns/prefix.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/prefix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/prefix.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/suffix.exp.json b/testdata/d2ir/TestCompile/patterns/suffix.exp.json new file mode 100644 index 000000000..40da3b5a1 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/suffix.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "animal", + "primary": { + "value": { + "range": "TestCompile/patterns/suffix.d2,2:4:30-2:11:37", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/suffix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/suffix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/suffix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/suffix.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/patterns/suffix.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/suffix.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/suffix.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "jingle", + "primary": { + "value": { + "range": "TestCompile/patterns/suffix.d2,2:4:30-2:11:37", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/suffix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "jingle", + "raw_string": "jingle" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/suffix.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/suffix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "jingle", + "raw_string": "jingle" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/suffix.d2,1:0:13-1:12:25", + "key": { + "range": "TestCompile/patterns/suffix.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/suffix.d2,1:0:13-1:6:19", + "value": [ + { + "string": "jingle", + "raw_string": "jingle" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/suffix.d2,1:8:21-1:12:25", + "value": [ + { + "string": "loud", + "raw_string": "loud" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} From 210816a42b8a8ad2f347686fd15fb7216c1ea94d Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Fri, 14 Jul 2023 14:22:02 -0700 Subject: [PATCH 02/15] d2ir: Fix _ with null --- d2ir/compile.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/d2ir/compile.go b/d2ir/compile.go index f8e0ff67c..c68330542 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -396,15 +396,6 @@ func (c *compiler) compileKey(refctx *RefContext) { } func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) { - if refctx.Key != nil && len(refctx.Key.Edges) == 0 && refctx.Key.Value.Null != nil { - // For vars, if we delete the field, it may just resolve to an outer scope var of the same name - // Instead we keep it around, so that resolveSubstitutions can find it - if !IsVar(dst) { - dst.DeleteField(kp.IDA()...) - return - } - } - us, ok := kp.Path[0].Unbox().(*d2ast.UnquotedString) if ok && us.Pattern != nil { for _, f := range dst.Fields { @@ -429,6 +420,15 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) } func (c *compiler) _compileField(f *Field, refctx *RefContext) { + if len(refctx.Key.Edges) == 0 && refctx.Key.Value.Null != nil { + // For vars, if we delete the field, it may just resolve to an outer scope var of the same name + // Instead we keep it around, so that resolveSubstitutions can find it + if !IsVar(ParentMap(f)) { + dst.DeleteField(f.Name) + return + } + } + if refctx.Key.Primary.Unbox() != nil { f.Primary_ = &Scalar{ parent: f, From 1217ff35a7d00beec37e19c1ebe547b60f1e524d Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 24 Jun 2023 15:31:58 -0700 Subject: [PATCH 03/15] d2ir: Add single glob matching to edges and make it work fully recursively --- d2ast/d2ast.go | 7 + d2ir/compile.go | 112 +- d2ir/d2ir.go | 176 ++- d2ir/pattern_test.go | 80 +- d2parser/parse.go | 15 +- .../d2ir/TestCompile/edges/chain.exp.json | 1104 +++++++++++++++++ .../d2ir/TestCompile/edges/nested.exp.json | 660 ++++++++++ testdata/d2ir/TestCompile/edges/root.exp.json | 220 ++++ .../TestCompile/edges/underscore.exp.json | 415 +++++++ .../layers/errs/4/good_edge.exp.json | 396 ++++++ .../d2ir/TestCompile/layers/root.exp.json | 220 ++++ .../TestCompile/patterns/double-glob.exp.json | 573 +++++++++ .../d2ir/TestCompile/patterns/edge/1.exp.json | 582 +++++++++ .../d2ir/TestCompile/patterns/edge/2.exp.json | 862 +++++++++++++ .../d2ir/TestCompile/patterns/edge/3.exp.json | 1022 +++++++++++++++ .../patterns/nested/prefix-suffix/3.exp.json | 997 +++++++++++++++ .../d2ir/TestCompile/scenarios/edge.exp.json | 440 +++++++ .../d2ir/TestCompile/scenarios/root.exp.json | 660 ++++++++++ .../d2ir/TestCompile/steps/recursive.exp.json | 880 +++++++++++++ testdata/d2ir/TestCompile/steps/root.exp.json | 660 ++++++++++ 20 files changed, 9975 insertions(+), 106 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/double-glob.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/edge/1.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/edge/2.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/edge/3.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/nested/prefix-suffix/3.exp.json diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index 629612c22..83ee1b54b 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -740,6 +740,13 @@ func (kp *KeyPath) IDA() (ida []string) { return ida } +func (kp *KeyPath) Copy() *KeyPath { + kp2 := *kp + kp2.Path = nil + kp2.Path = append(kp2.Path, kp.Path...) + return &kp2 +} + type Edge struct { Range Range `json:"range"` diff --git a/d2ir/compile.go b/d2ir/compile.go index c68330542..962e1ec40 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -396,27 +396,15 @@ func (c *compiler) compileKey(refctx *RefContext) { } func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) { - us, ok := kp.Path[0].Unbox().(*d2ast.UnquotedString) - if ok && us.Pattern != nil { - for _, f := range dst.Fields { - if matchPattern(f.Name, us.Pattern) { - if len(kp.Path) == 1 { - c._compileField(f, refctx) - } else { - // TODO: recurse - } - } - } - return - } - - f, err := dst.EnsureField(kp, refctx) + fa, err := dst.EnsureField(kp, refctx) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) return } - c._compileField(f, refctx) + for _, f := range fa { + c._compileField(f, refctx) + } } func (c *compiler) _compileField(f *Field, refctx *RefContext) { @@ -424,7 +412,7 @@ func (c *compiler) _compileField(f *Field, refctx *RefContext) { // For vars, if we delete the field, it may just resolve to an outer scope var of the same name // Instead we keep it around, so that resolveSubstitutions can find it if !IsVar(ParentMap(f)) { - dst.DeleteField(f.Name) + ParentMap(f).DeleteField(f.Name) return } } @@ -621,12 +609,17 @@ func (c *compiler) compileLink(refctx *RefContext) { } func (c *compiler) compileEdges(refctx *RefContext) { - if refctx.Key.Key != nil { - f, err := refctx.ScopeMap.EnsureField(refctx.Key.Key, refctx) - if err != nil { - c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) - return - } + if refctx.Key.Key == nil { + c._compileEdges(refctx) + return + } + + fa, err := refctx.ScopeMap.EnsureField(refctx.Key.Key, refctx) + if err != nil { + c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) + return + } + for _, f := range fa { if _, ok := f.Composite.(*Array); ok { c.errorf(refctx.Key.Key, "cannot index into array") return @@ -636,9 +629,13 @@ func (c *compiler) compileEdges(refctx *RefContext) { parent: f, } } - refctx.ScopeMap = f.Map() + refctx2 := *refctx + refctx2.ScopeMap = f.Map() + c._compileEdges(&refctx2) } +} +func (c *compiler) _compileEdges(refctx *RefContext) { eida := NewEdgeIDs(refctx.Key) for i, eid := range eida { if refctx.Key != nil && refctx.Key.Value.Null != nil { @@ -649,19 +646,20 @@ func (c *compiler) compileEdges(refctx *RefContext) { refctx = refctx.Copy() refctx.Edge = refctx.Key.Edges[i] - var e *Edge + var ea []*Edge if eid.Index != nil { - ea := refctx.ScopeMap.GetEdges(eid) + ea = refctx.ScopeMap.GetEdges(eid) if len(ea) == 0 { c.errorf(refctx.Edge, "indexed edge does not exist") continue } - e = ea[0] - e.References = append(e.References, &EdgeReference{ - Context: refctx, - }) - refctx.ScopeMap.appendFieldReferences(0, refctx.Edge.Src, refctx) - refctx.ScopeMap.appendFieldReferences(0, refctx.Edge.Dst, refctx) + for _, e := range ea { + e.References = append(e.References, &EdgeReference{ + Context: refctx, + }) + refctx.ScopeMap.appendFieldReferences(0, refctx.Edge.Src, refctx) + refctx.ScopeMap.appendFieldReferences(0, refctx.Edge.Dst, refctx) + } } else { _, err := refctx.ScopeMap.EnsureField(refctx.Edge.Src, refctx) if err != nil { @@ -674,41 +672,43 @@ func (c *compiler) compileEdges(refctx *RefContext) { continue } - e, err = refctx.ScopeMap.CreateEdge(eid, refctx) + ea, err = refctx.ScopeMap.CreateEdge(eid, refctx) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) continue } } - if refctx.Key.EdgeKey != nil { - if e.Map_ == nil { - e.Map_ = &Map{ - parent: e, - } - } - c.compileField(e.Map_, refctx.Key.EdgeKey, refctx) - } else { - if refctx.Key.Primary.Unbox() != nil { - e.Primary_ = &Scalar{ - parent: e, - Value: refctx.Key.Primary.Unbox(), - } - } - if refctx.Key.Value.Array != nil { - c.errorf(refctx.Key.Value.Unbox(), "edges cannot be assigned arrays") - continue - } else if refctx.Key.Value.Map != nil { + for _, e := range ea { + if refctx.Key.EdgeKey != nil { if e.Map_ == nil { e.Map_ = &Map{ parent: e, } + c.compileField(e.Map_, refctx.Key.EdgeKey, refctx) } - c.compileMap(e.Map_, refctx.Key.Value.Map, refctx.ScopeAST) - } else if refctx.Key.Value.ScalarBox().Unbox() != nil { - e.Primary_ = &Scalar{ - parent: e, - Value: refctx.Key.Value.ScalarBox().Unbox(), + } else { + if refctx.Key.Primary.Unbox() != nil { + e.Primary_ = &Scalar{ + parent: e, + Value: refctx.Key.Primary.Unbox(), + } + } + if refctx.Key.Value.Array != nil { + c.errorf(refctx.Key.Value.Unbox(), "edges cannot be assigned arrays") + continue + } else if refctx.Key.Value.Map != nil { + if e.Map_ == nil { + e.Map_ = &Map{ + parent: e, + } + } + c.compileMap(e.Map_, refctx.Key.Value.Map, refctx.ScopeAST) + } else if refctx.Key.Value.ScalarBox().Unbox() != nil { + e.Primary_ = &Scalar{ + parent: e, + Value: refctx.Key.Value.ScalarBox().Unbox(), + } } } } diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index 1160021f4..28d1c6d8e 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -651,7 +651,7 @@ func (m *Map) getField(ida []string) *Field { return nil } -func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext) (*Field, error) { +func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext) ([]*Field, error) { i := 0 for kp.Path[i].Unbox().ScalarString() == "_" { m = ParentMap(m) @@ -663,29 +663,46 @@ func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext) (*Field, error) } i++ } - return m.ensureField(i, kp, refctx) + + var fa []*Field + err := m.ensureField(i, kp, refctx, &fa) + return fa, err } -func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext) (*Field, error) { +func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*Field) error { + us, ok := kp.Path[i].Unbox().(*d2ast.UnquotedString) + if ok && us.Pattern != nil { + for _, f := range m.Fields { + if matchPattern(f.Name, us.Pattern) { + if i == len(kp.Path)-1 { + *fa = append(*fa, f) + } else if f.Map() != nil { + f.Map().ensureField(i+1, kp, refctx, fa) + } + } + } + return nil + } + head := kp.Path[i].Unbox().ScalarString() if _, ok := d2graph.ReservedKeywords[strings.ToLower(head)]; ok { head = strings.ToLower(head) if _, ok := d2graph.CompositeReservedKeywords[head]; !ok && i < len(kp.Path)-1 { - return nil, d2parser.Errorf(kp.Path[i].Unbox(), fmt.Sprintf(`"%s" must be the last part of the key`, head)) + return d2parser.Errorf(kp.Path[i].Unbox(), fmt.Sprintf(`"%s" must be the last part of the key`, head)) } } if head == "_" { - return nil, d2parser.Errorf(kp.Path[i].Unbox(), `parent "_" can only be used in the beginning of paths, e.g. "_.x"`) + return d2parser.Errorf(kp.Path[i].Unbox(), `parent "_" can only be used in the beginning of paths, e.g. "_.x"`) } if head == "classes" && NodeBoardKind(m) == "" { - return nil, d2parser.Errorf(kp.Path[i].Unbox(), "%s is only allowed at a board root", head) + return d2parser.Errorf(kp.Path[i].Unbox(), "%s is only allowed at a board root", head) } if findBoardKeyword(head) != -1 && NodeBoardKind(m) == "" { - return nil, d2parser.Errorf(kp.Path[i].Unbox(), "%s is only allowed at a board root", head) + return d2parser.Errorf(kp.Path[i].Unbox(), "%s is only allowed at a board root", head) } for _, f := range m.Fields { @@ -703,17 +720,18 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext) (*Field, } if i+1 == len(kp.Path) { - return f, nil + *fa = append(*fa, f) + return nil } if _, ok := f.Composite.(*Array); ok { - return nil, d2parser.Errorf(kp.Path[i].Unbox(), "cannot index into array") + return d2parser.Errorf(kp.Path[i].Unbox(), "cannot index into array") } if f.Map() == nil { f.Composite = &Map{ parent: f, } } - return f.Map().ensureField(i+1, kp, refctx) + return f.Map().ensureField(i+1, kp, refctx, fa) } f := &Field{ @@ -730,12 +748,13 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext) (*Field, } m.Fields = append(m.Fields, f) if i+1 == len(kp.Path) { - return f, nil + *fa = append(*fa, f) + return nil } f.Composite = &Map{ parent: f, } - return f.Map().ensureField(i+1, kp, refctx) + return f.Map().ensureField(i+1, kp, refctx, fa) } func (m *Map) DeleteEdge(eid *EdgeID) *Edge { @@ -825,57 +844,128 @@ func (m *Map) GetEdges(eid *EdgeID) []*Edge { return ea } -func (m *Map) CreateEdge(eid *EdgeID, refctx *RefContext) (*Edge, error) { +func (m *Map) CreateEdge(eid *EdgeID, refctx *RefContext) ([]*Edge, error) { + var ea []*Edge + return ea, m.createEdge(eid, refctx, &ea) +} + +func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { if ParentEdge(m) != nil { - return nil, d2parser.Errorf(refctx.Edge, "cannot create edge inside edge") + return d2parser.Errorf(refctx.Edge, "cannot create edge inside edge") } eid, m, common, err := eid.resolve(m) if err != nil { - return nil, d2parser.Errorf(refctx.Edge, err.Error()) + return d2parser.Errorf(refctx.Edge, err.Error()) } if len(common) > 0 { - f, err := m.EnsureField(d2ast.MakeKeyPath(common), nil) + commonEnd := len(refctx.Edge.Src.Path) - len(eid.SrcPath) + commonStart := commonEnd - len(common) + commonKP := refctx.Edge.Src.Copy() + commonKP.Path = commonKP.Path[commonStart:commonEnd] + fa, err := m.EnsureField(commonKP, nil) if err != nil { - return nil, err + return err } - if _, ok := f.Composite.(*Array); ok { - return nil, d2parser.Errorf(refctx.Edge.Src, "cannot index into array") - } - if f.Map() == nil { - f.Composite = &Map{ - parent: f, + for _, f := range fa { + if _, ok := f.Composite.(*Array); ok { + return d2parser.Errorf(refctx.Edge.Src, "cannot index into array") + } + if f.Map() == nil { + f.Composite = &Map{ + parent: f, + } + } + err = f.Map().createEdge(eid, refctx, ea) + if err != nil { + return err } } - return f.Map().CreateEdge(eid, refctx) + return nil } ij := findProhibitedEdgeKeyword(eid.SrcPath...) if ij != -1 { - return nil, d2parser.Errorf(refctx.Edge.Src.Path[ij].Unbox(), "reserved keywords are prohibited in edges") + return d2parser.Errorf(refctx.Edge.Src.Path[ij].Unbox(), "reserved keywords are prohibited in edges") } ij = findBoardKeyword(eid.SrcPath...) if ij == len(eid.SrcPath)-1 { - return nil, d2parser.Errorf(refctx.Edge.Src.Path[ij].Unbox(), "edge with board keyword alone doesn't make sense") + return d2parser.Errorf(refctx.Edge.Src.Path[ij].Unbox(), "edge with board keyword alone doesn't make sense") } - src := m.GetField(eid.SrcPath...) - if NodeBoardKind(src) != "" { - return nil, d2parser.Errorf(refctx.Edge.Src, "cannot create edges between boards") + + srcStart := len(refctx.Edge.Src.Path) - len(eid.SrcPath) + if srcStart < 0 { + srcStart = 0 } + srcKP := refctx.Edge.Src.Copy() + srcKP.Path = srcKP.Path[srcStart:] ij = findProhibitedEdgeKeyword(eid.DstPath...) if ij != -1 { - return nil, d2parser.Errorf(refctx.Edge.Dst.Path[ij].Unbox(), "reserved keywords are prohibited in edges") + return d2parser.Errorf(refctx.Edge.Dst.Path[ij].Unbox(), "reserved keywords are prohibited in edges") } ij = findBoardKeyword(eid.DstPath...) if ij == len(eid.DstPath)-1 { - return nil, d2parser.Errorf(refctx.Edge.Dst.Path[ij].Unbox(), "edge with board keyword alone doesn't make sense") + return d2parser.Errorf(refctx.Edge.Dst.Path[ij].Unbox(), "edge with board keyword alone doesn't make sense") + } + + dstStart := len(refctx.Edge.Dst.Path) - len(eid.DstPath) + if dstStart < 0 { + dstStart = 0 + } + dstKP := refctx.Edge.Dst.Copy() + dstKP.Path = dstKP.Path[dstStart:] + + underscoresCountSrc := 0 + underscoresCountDst := 0 + for _, el := range refctx.Edge.Src.Path { + if el.ScalarString() == "_" { + underscoresCountSrc++ + } + } + for _, el := range refctx.Edge.Dst.Path { + if el.ScalarString() == "_" { + underscoresCountDst++ + } + } + for i := 0; i < underscoresCountDst; i++ { + srcKP.Path = append([]*d2ast.StringBox{d2ast.RawStringBox(eid.SrcPath[i], true)}, srcKP.Path...) + } + for i := 0; i < underscoresCountSrc; i++ { + dstKP.Path = append([]*d2ast.StringBox{d2ast.RawStringBox(eid.DstPath[i], true)}, dstKP.Path...) + } + + srcFA, err := m.EnsureField(srcKP, refctx) + if err != nil { + return err + } + dstFA, err := m.EnsureField(dstKP, refctx) + if err != nil { + return err + } + + for _, src := range srcFA { + for _, dst := range dstFA { + eid2 := eid.Copy() + eid2.SrcPath = RelIDA(m, src) + eid2.DstPath = RelIDA(m, dst) + e, err := m.createEdge2(eid2, refctx, src, dst) + if err != nil { + return err + } + *ea = append(*ea, e) + } + } + return nil +} + +func (m *Map) createEdge2(eid *EdgeID, refctx *RefContext, src, dst *Field) (*Edge, error) { + if NodeBoardKind(src) != "" { + return nil, d2parser.Errorf(refctx.Edge.Src, "cannot create edges between boards") } - dst := m.GetField(eid.DstPath...) if NodeBoardKind(dst) != "" { return nil, d2parser.Errorf(refctx.Edge.Dst, "cannot create edges between boards") } - if ParentBoard(src) != ParentBoard(dst) { return nil, d2parser.Errorf(refctx.Edge, "cannot create edges between boards") } @@ -1159,6 +1249,26 @@ func IDA(n Node) (ida []string) { } } +// RelIDA returns the absolute path to n relative to p. +func RelIDA(p, n Node) (ida []string) { + for { + f, ok := n.(*Field) + if ok { + ida = append(ida, f.Name) + if f.Root() { + reverseIDA(ida) + return ida + } + } + f = ParentField(n) + if f == nil || f.Root() || f == p || f.Composite == p { + reverseIDA(ida) + return ida + } + n = f + } +} + func reverseIDA(ida []string) { for i := 0; i < len(ida)/2; i++ { tmp := ida[i] diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index b1709080d..e264e5e02 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -10,6 +10,19 @@ func testCompilePatterns(t *testing.T) { t.Parallel() tca := []testCase{ + { + name: "escaped", + run: func(t testing.TB) { + m, err := compile(t, `animal: meow +action: yes +a\*: globbed`) + assert.Success(t, err) + assertQuery(t, m, 3, 0, nil, "") + assertQuery(t, m, 0, 0, "meow", "animal") + assertQuery(t, m, 0, 0, "yes", "action") + assertQuery(t, m, 0, 0, "globbed", `a\*`) + }, + }, { name: "prefix", run: func(t testing.TB) { @@ -71,16 +84,67 @@ t*ink*r*t*inke*: globbed`) }, }, { - name: "escaped", + name: "nested/prefix-suffix/3", run: func(t testing.TB) { - m, err := compile(t, `animal: meow -action: yes -a\*: globbed`) + m, err := compile(t, `animate.constant.tinkertinker: meow +astronaut.constant.thinkerthinker: yes +a*n*t*.constant.t*ink*r*t*inke*: globbed`) assert.Success(t, err) - assertQuery(t, m, 3, 0, nil, "") - assertQuery(t, m, 0, 0, "meow", "animal") - assertQuery(t, m, 0, 0, "yes", "action") - assertQuery(t, m, 0, 0, "globbed", `a\*`) + assertQuery(t, m, 6, 0, nil, "") + assertQuery(t, m, 0, 0, "globbed", "animate.constant.tinkertinker") + assertQuery(t, m, 0, 0, "globbed", "astronaut.constant.thinkerthinker") + }, + }, + { + name: "edge/1", + run: func(t testing.TB) { + m, err := compile(t, `animate +animal +an* -> an*`) + assert.Success(t, err) + assertQuery(t, m, 2, 4, nil, "") + assertQuery(t, m, 0, 0, nil, "(animate -> animal)[0]") + assertQuery(t, m, 0, 0, nil, "(animal -> animal)[0]") + }, + }, + { + name: "edge/2", + run: func(t testing.TB) { + m, err := compile(t, `shared.animate +shared.animal +sh*.(an* -> an*)`) + assert.Success(t, err) + assertQuery(t, m, 3, 4, nil, "") + assertQuery(t, m, 2, 4, nil, "shared") + assertQuery(t, m, 0, 0, nil, "shared.(animate -> animal)[0]") + assertQuery(t, m, 0, 0, nil, "shared.(animal -> animal)[0]") + }, + }, + { + name: "edge/3", + run: func(t testing.TB) { + m, err := compile(t, `shared.animate +shared.animal +sh*.an* -> sh*.an*`) + assert.Success(t, err) + assertQuery(t, m, 3, 4, nil, "") + assertQuery(t, m, 2, 4, nil, "shared") + assertQuery(t, m, 0, 0, nil, "shared.(animate -> animal)[0]") + assertQuery(t, m, 0, 0, nil, "shared.(animal -> animal)[0]") + }, + }, + { + name: "double-glob", + run: func(t testing.TB) { + m, err := compile(t, `shared.animate +shared.animal +**.style.fill: red`) + assert.Success(t, err) + assertQuery(t, m, 9, 0, nil, "") + assertQuery(t, m, 8, 0, nil, "shared") + assertQuery(t, m, 2, 0, nil, "shared.style") + assertQuery(t, m, 2, 0, nil, "shared.animate") + assertQuery(t, m, 2, 0, nil, "shared.animal") }, }, } diff --git a/d2parser/parse.go b/d2parser/parse.go index d7a540897..6f792d374 100644 --- a/d2parser/parse.go +++ b/d2parser/parse.go @@ -1030,9 +1030,15 @@ func (p *parser) parseUnquotedString(inKey bool) (s *d2ast.UnquotedString) { var sb strings.Builder var rawb strings.Builder + lastPatternIndex := 0 defer func() { sv := strings.TrimRightFunc(sb.String(), unicode.IsSpace) rawv := strings.TrimRightFunc(rawb.String(), unicode.IsSpace) + if s.Pattern != nil { + if lastPatternIndex < len(sv) { + s.Pattern = append(s.Pattern, sv[lastPatternIndex:]) + } + } if sv == "" { if len(s.Value) > 0 { return @@ -1046,15 +1052,6 @@ func (p *parser) parseUnquotedString(inKey bool) (s *d2ast.UnquotedString) { s.Value = append(s.Value, d2ast.InterpolationBox{String: &sv, StringRaw: &rawv}) }() - lastPatternIndex := 0 - defer func() { - if s.Pattern != nil { - if lastPatternIndex < sb.Len() { - s.Pattern = append(s.Pattern, sb.String()[lastPatternIndex:]) - } - } - }() - _s, eof := p.peekn(4) p.rewind() if !eof { diff --git a/testdata/d2ir/TestCompile/edges/chain.exp.json b/testdata/d2ir/TestCompile/edges/chain.exp.json index ea4624895..3708c3f1e 100644 --- a/testdata/d2ir/TestCompile/edges/chain.exp.json +++ b/testdata/d2ir/TestCompile/edges/chain.exp.json @@ -186,6 +186,190 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", + "edges": [ + { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -376,6 +560,374 @@ } } }, + { + "string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", + "edges": [ + { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", + "edges": [ + { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, { "string": { "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", @@ -749,6 +1301,374 @@ } } }, + { + "string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", + "edges": [ + { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", + "edges": [ + { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, { "string": { "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", @@ -1121,6 +2041,190 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", + "edges": [ + { + "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", + "src": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + { + "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", + "src": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } diff --git a/testdata/d2ir/TestCompile/edges/nested.exp.json b/testdata/d2ir/TestCompile/edges/nested.exp.json index 06d098b77..e49102cd2 100644 --- a/testdata/d2ir/TestCompile/edges/nested.exp.json +++ b/testdata/d2ir/TestCompile/edges/nested.exp.json @@ -171,6 +171,171 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "edges": [ + { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } @@ -342,6 +507,171 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "edges": [ + { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -516,6 +846,171 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "edges": [ + { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } @@ -687,6 +1182,171 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "edges": [ + { + "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", + "src": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } diff --git a/testdata/d2ir/TestCompile/edges/root.exp.json b/testdata/d2ir/TestCompile/edges/root.exp.json index a94dd5651..3938e435b 100644 --- a/testdata/d2ir/TestCompile/edges/root.exp.json +++ b/testdata/d2ir/TestCompile/edges/root.exp.json @@ -112,6 +112,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -227,6 +337,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } diff --git a/testdata/d2ir/TestCompile/edges/underscore.exp.json b/testdata/d2ir/TestCompile/edges/underscore.exp.json index 878a4cff4..f97efdddb 100644 --- a/testdata/d2ir/TestCompile/edges/underscore.exp.json +++ b/testdata/d2ir/TestCompile/edges/underscore.exp.json @@ -138,6 +138,148 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "p" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", + "src": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:14:14", + "edges": [ + { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", + "src": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } @@ -258,6 +400,147 @@ } } } + }, + { + "string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "p" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "p" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", + "src": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:14:14", + "edges": [ + { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", + "src": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -406,6 +689,138 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", + "src": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:14:14", + "edges": [ + { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", + "src": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", + "value": [ + { + "string": "_", + "raw_string": "_" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } diff --git a/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json b/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json index 7a7f1e434..754264164 100644 --- a/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json +++ b/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json @@ -450,6 +450,402 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", + "src": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", + "edges": [ + { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", + "src": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", + "src": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", + "edges": [ + { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", + "src": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] } diff --git a/testdata/d2ir/TestCompile/layers/root.exp.json b/testdata/d2ir/TestCompile/layers/root.exp.json index 27e7e95c6..6c8ca2fa4 100644 --- a/testdata/d2ir/TestCompile/layers/root.exp.json +++ b/testdata/d2ir/TestCompile/layers/root.exp.json @@ -112,6 +112,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -227,6 +337,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, diff --git a/testdata/d2ir/TestCompile/patterns/double-glob.exp.json b/testdata/d2ir/TestCompile/patterns/double-glob.exp.json new file mode 100644 index 000000000..e50aa0ff6 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/double-glob.exp.json @@ -0,0 +1,573 @@ +{ + "fields": [ + { + "name": "shared", + "composite": { + "fields": [ + { + "name": "animate", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "animal", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/double-glob.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/edge/1.exp.json b/testdata/d2ir/TestCompile/patterns/edge/1.exp.json new file mode 100644 index 000000000..dff85c37a --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/edge/1.exp.json @@ -0,0 +1,582 @@ +{ + "fields": [ + { + "name": "animate", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/1.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/1.d2,0:0:0-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/1.d2,0:0:0-0:7:7", + "key": { + "range": "TestCompile/patterns/edge/1.d2,0:0:0-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "animal", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/1.d2,1:0:8-1:6:14", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/1.d2,1:0:8-1:6:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,1:0:8-1:6:14", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/1.d2,1:0:8-1:6:14", + "key": { + "range": "TestCompile/patterns/edge/1.d2,1:0:8-1:6:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,1:0:8-1:6:14", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "animate" + ], + "src_arrow": false, + "dst_path": [ + "animate" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "edges": [ + { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animate" + ], + "src_arrow": false, + "dst_path": [ + "animal" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "edges": [ + { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animal" + ], + "src_arrow": false, + "dst_path": [ + "animate" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "edges": [ + { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animal" + ], + "src_arrow": false, + "dst_path": [ + "animal" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "edges": [ + { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", + "src": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] +} diff --git a/testdata/d2ir/TestCompile/patterns/edge/2.exp.json b/testdata/d2ir/TestCompile/patterns/edge/2.exp.json new file mode 100644 index 000000000..b5d8b16a5 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/edge/2.exp.json @@ -0,0 +1,862 @@ +{ + "fields": [ + { + "name": "shared", + "composite": { + "fields": [ + { + "name": "animate", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/2.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "animal", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/2.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "animate" + ], + "src_arrow": false, + "dst_path": [ + "animate" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45", + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + } + ] + }, + "edges": [ + { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animate" + ], + "src_arrow": false, + "dst_path": [ + "animal" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45", + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + } + ] + }, + "edges": [ + { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animal" + ], + "src_arrow": false, + "dst_path": [ + "animate" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45", + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + } + ] + }, + "edges": [ + { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animal" + ], + "src_arrow": false, + "dst_path": [ + "animal" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45", + "key": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + } + ] + }, + "edges": [ + { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", + "src": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/2.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/edge/3.exp.json b/testdata/d2ir/TestCompile/patterns/edge/3.exp.json new file mode 100644 index 000000000..7f8948ac4 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/edge/3.exp.json @@ -0,0 +1,1022 @@ +{ + "fields": [ + { + "name": "shared", + "composite": { + "fields": [ + { + "name": "animate", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/3.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "animal", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/3.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "animate" + ], + "src_arrow": false, + "dst_path": [ + "animate" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "edges": [ + { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animate" + ], + "src_arrow": false, + "dst_path": [ + "animal" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "edges": [ + { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animal" + ], + "src_arrow": false, + "dst_path": [ + "animate" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "edges": [ + { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "animal" + ], + "src_arrow": false, + "dst_path": [ + "animal" + ], + "dst_arrow": true, + "index": 0 + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "edges": [ + { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", + "src": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", + "value": [ + { + "string": "sh*", + "raw_string": "sh*" + } + ], + "pattern": [ + "sh", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", + "value": [ + { + "string": "an*", + "raw_string": "an*" + } + ], + "pattern": [ + "an", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge/3.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/nested/prefix-suffix/3.exp.json b/testdata/d2ir/TestCompile/patterns/nested/prefix-suffix/3.exp.json new file mode 100644 index 000000000..9b5259d95 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/nested/prefix-suffix/3.exp.json @@ -0,0 +1,997 @@ +{ + "fields": [ + { + "name": "animate", + "composite": { + "fields": [ + { + "name": "constant", + "composite": { + "fields": [ + { + "name": "tinkertinker", + "primary": { + "value": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:33:108-2:40:115", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:17:17-0:29:29", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:29:29", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:8:8-0:16:16", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:17:17-0:29:29", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:35:35", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:29:29", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:8:8-0:16:16", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:17:17-0:29:29", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:31:31-0:35:35", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:8:8-0:16:16", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:29:29", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:8:8-0:16:16", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:17:17-0:29:29", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:35:35", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:29:29", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:8:8-0:16:16", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:17:17-0:29:29", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:31:31-0:35:35", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:7:82-2:15:90", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:31:106", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:6:81", + "value": [ + { + "string": "a*n*t*", + "raw_string": "a*n*t*" + } + ], + "pattern": [ + "a", + "*", + "n", + "*", + "t", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:7:82-2:15:90", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:16:91-2:31:106", + "value": [ + { + "string": "t*ink*r*t*inke*", + "raw_string": "t*ink*r*t*inke*" + } + ], + "pattern": [ + "t", + "*", + "ink", + "*", + "r", + "*", + "t", + "*", + "inke", + "*" + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:40:115", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:31:106", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:6:81", + "value": [ + { + "string": "a*n*t*", + "raw_string": "a*n*t*" + } + ], + "pattern": [ + "a", + "*", + "n", + "*", + "t", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:7:82-2:15:90", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:16:91-2:31:106", + "value": [ + { + "string": "t*ink*r*t*inke*", + "raw_string": "t*ink*r*t*inke*" + } + ], + "pattern": [ + "t", + "*", + "ink", + "*", + "r", + "*", + "t", + "*", + "inke", + "*" + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:33:108-2:40:115", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:29:29", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:8:8-0:16:16", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:17:17-0:29:29", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:35:35", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:29:29", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:0:0-0:7:7", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:8:8-0:16:16", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:17:17-0:29:29", + "value": [ + { + "string": "tinkertinker", + "raw_string": "tinkertinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,0:31:31-0:35:35", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "astronaut", + "composite": { + "fields": [ + { + "name": "constant", + "composite": { + "fields": [ + { + "name": "thinkerthinker", + "primary": { + "value": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:33:108-2:40:115", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:19:55-1:33:69", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:33:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:9:45", + "value": [ + { + "string": "astronaut", + "raw_string": "astronaut" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:10:46-1:18:54", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:19:55-1:33:69", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:38:74", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:33:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:9:45", + "value": [ + { + "string": "astronaut", + "raw_string": "astronaut" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:10:46-1:18:54", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:19:55-1:33:69", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:35:71-1:38:74", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:10:46-1:18:54", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:33:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:9:45", + "value": [ + { + "string": "astronaut", + "raw_string": "astronaut" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:10:46-1:18:54", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:19:55-1:33:69", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:38:74", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:33:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:9:45", + "value": [ + { + "string": "astronaut", + "raw_string": "astronaut" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:10:46-1:18:54", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:19:55-1:33:69", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:35:71-1:38:74", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:7:82-2:15:90", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:31:106", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:6:81", + "value": [ + { + "string": "a*n*t*", + "raw_string": "a*n*t*" + } + ], + "pattern": [ + "a", + "*", + "n", + "*", + "t", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:7:82-2:15:90", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:16:91-2:31:106", + "value": [ + { + "string": "t*ink*r*t*inke*", + "raw_string": "t*ink*r*t*inke*" + } + ], + "pattern": [ + "t", + "*", + "ink", + "*", + "r", + "*", + "t", + "*", + "inke", + "*" + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:40:115", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:31:106", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:0:75-2:6:81", + "value": [ + { + "string": "a*n*t*", + "raw_string": "a*n*t*" + } + ], + "pattern": [ + "a", + "*", + "n", + "*", + "t", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:7:82-2:15:90", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:16:91-2:31:106", + "value": [ + { + "string": "t*ink*r*t*inke*", + "raw_string": "t*ink*r*t*inke*" + } + ], + "pattern": [ + "t", + "*", + "ink", + "*", + "r", + "*", + "t", + "*", + "inke", + "*" + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,2:33:108-2:40:115", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:9:45", + "value": [ + { + "string": "astronaut", + "raw_string": "astronaut" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:33:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:9:45", + "value": [ + { + "string": "astronaut", + "raw_string": "astronaut" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:10:46-1:18:54", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:19:55-1:33:69", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:38:74", + "key": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:33:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:0:36-1:9:45", + "value": [ + { + "string": "astronaut", + "raw_string": "astronaut" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:10:46-1:18:54", + "value": [ + { + "string": "constant", + "raw_string": "constant" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:19:55-1:33:69", + "value": [ + { + "string": "thinkerthinker", + "raw_string": "thinkerthinker" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/nested/prefix-suffix/3.d2,1:35:71-1:38:74", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/scenarios/edge.exp.json b/testdata/d2ir/TestCompile/scenarios/edge.exp.json index 37f6f502a..7bfb0dce9 100644 --- a/testdata/d2ir/TestCompile/scenarios/edge.exp.json +++ b/testdata/d2ir/TestCompile/scenarios/edge.exp.json @@ -112,6 +112,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -227,6 +337,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -351,6 +571,116 @@ } } }, + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, { "string": { "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", @@ -614,6 +944,116 @@ } } }, + { + "string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, { "string": { "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", diff --git a/testdata/d2ir/TestCompile/scenarios/root.exp.json b/testdata/d2ir/TestCompile/scenarios/root.exp.json index 591518abf..31100d590 100644 --- a/testdata/d2ir/TestCompile/scenarios/root.exp.json +++ b/testdata/d2ir/TestCompile/scenarios/root.exp.json @@ -112,6 +112,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -227,6 +337,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -350,6 +570,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -465,6 +795,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1103,6 +1543,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1218,6 +1768,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, diff --git a/testdata/d2ir/TestCompile/steps/recursive.exp.json b/testdata/d2ir/TestCompile/steps/recursive.exp.json index 3e09926d4..f92eec4b9 100644 --- a/testdata/d2ir/TestCompile/steps/recursive.exp.json +++ b/testdata/d2ir/TestCompile/steps/recursive.exp.json @@ -112,6 +112,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -227,6 +337,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -350,6 +570,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -465,6 +795,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1103,6 +1543,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1218,6 +1768,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1707,6 +2367,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1822,6 +2592,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, diff --git a/testdata/d2ir/TestCompile/steps/root.exp.json b/testdata/d2ir/TestCompile/steps/root.exp.json index ec142d977..51f9d002c 100644 --- a/testdata/d2ir/TestCompile/steps/root.exp.json +++ b/testdata/d2ir/TestCompile/steps/root.exp.json @@ -112,6 +112,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -227,6 +337,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -350,6 +570,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -465,6 +795,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1103,6 +1543,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, @@ -1218,6 +1768,116 @@ "value": {} } } + }, + { + "string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } } ] }, From d9b4b952eed3210e3016a2402c22eed1e1702e39 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Thu, 27 Jul 2023 02:36:33 -0700 Subject: [PATCH 04/15] d2ir: Implement double globs --- d2ir/d2ir.go | 31 +- d2ir/pattern.go | 23 + d2ir/pattern_test.go | 6 +- .../TestCompile/patterns/double-glob.exp.json | 496 ++++++-- .../patterns/double-glob/1.exp.json | 1095 +++++++++++++++++ 5 files changed, 1564 insertions(+), 87 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/double-glob/1.exp.json diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index 28d1c6d8e..8ef67de0b 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -672,12 +672,39 @@ func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext) ([]*Field, erro func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*Field) error { us, ok := kp.Path[i].Unbox().(*d2ast.UnquotedString) if ok && us.Pattern != nil { + fa2, ok := m.doubleGlob(us.Pattern) + if ok { + if i == len(kp.Path)-1 { + *fa = append(*fa, fa2...) + } else { + for _, f := range fa2 { + if f.Map() == nil { + f.Composite = &Map{ + parent: f, + } + } + err := f.Map().ensureField(i+1, kp, refctx, fa) + if err != nil { + return err + } + } + } + return nil + } for _, f := range m.Fields { if matchPattern(f.Name, us.Pattern) { if i == len(kp.Path)-1 { *fa = append(*fa, f) - } else if f.Map() != nil { - f.Map().ensureField(i+1, kp, refctx, fa) + } else { + if f.Map() == nil { + f.Composite = &Map{ + parent: f, + } + } + err := f.Map().ensureField(i+1, kp, refctx, fa) + if err != nil { + return err + } } } } diff --git a/d2ir/pattern.go b/d2ir/pattern.go index 39fd5c397..90773cca3 100644 --- a/d2ir/pattern.go +++ b/d2ir/pattern.go @@ -2,8 +2,31 @@ package d2ir import ( "strings" + + "oss.terrastruct.com/d2/d2graph" ) +func (m *Map) doubleGlob(pattern []string) ([]*Field, bool) { + if !(len(pattern) == 3 && pattern[0] == "*" && pattern[1] == "" && pattern[2] == "*") { + return nil, false + } + var fa []*Field + m._doubleGlob(&fa) + return fa, true +} + +func (m *Map) _doubleGlob(fa *[]*Field) { + for _, f := range m.Fields { + if _, ok := d2graph.ReservedKeywords[f.Name]; ok { + continue + } + *fa = append(*fa, f) + if f.Map() != nil { + f.Map()._doubleGlob(fa) + } + } +} + func matchPattern(s string, pattern []string) bool { if len(pattern) == 0 { return true diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index e264e5e02..90e6dd35c 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -134,7 +134,7 @@ sh*.an* -> sh*.an*`) }, }, { - name: "double-glob", + name: "double-glob/1", run: func(t testing.TB) { m, err := compile(t, `shared.animate shared.animal @@ -142,9 +142,11 @@ shared.animal assert.Success(t, err) assertQuery(t, m, 9, 0, nil, "") assertQuery(t, m, 8, 0, nil, "shared") - assertQuery(t, m, 2, 0, nil, "shared.style") + assertQuery(t, m, 1, 0, nil, "shared.style") assertQuery(t, m, 2, 0, nil, "shared.animate") + assertQuery(t, m, 1, 0, nil, "shared.animate.style") assertQuery(t, m, 2, 0, nil, "shared.animal") + assertQuery(t, m, 1, 0, nil, "shared.animal.style") }, }, } diff --git a/testdata/d2ir/TestCompile/patterns/double-glob.exp.json b/testdata/d2ir/TestCompile/patterns/double-glob.exp.json index e50aa0ff6..4696f0b15 100644 --- a/testdata/d2ir/TestCompile/patterns/double-glob.exp.json +++ b/testdata/d2ir/TestCompile/patterns/double-glob.exp.json @@ -6,6 +6,203 @@ "fields": [ { "name": "animate", + "composite": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:22:51", + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:22:51", + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, "references": [ { "string": { @@ -84,6 +281,203 @@ }, { "name": "animal", + "composite": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:22:51", + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:22:51", + "key": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, "references": [ { "string": { @@ -168,7 +562,7 @@ "name": "fill", "primary": { "value": { - "range": "TestCompile/patterns/double-glob.d2,2:15:44-2:18:47", + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", "value": [ { "string": "red", @@ -180,7 +574,7 @@ "references": [ { "string": { - "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", "value": [ { "string": "fill", @@ -189,27 +583,11 @@ ] }, "key_path": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", "path": [ { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", - "value": [ - { - "string": "**", - "raw_string": "**" - } - ], - "pattern": [ - "*", - "", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", "value": [ { "string": "style", @@ -220,7 +598,7 @@ }, { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", "value": [ { "string": "fill", @@ -234,29 +612,13 @@ "context": { "edge": null, "key": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:18:47", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:22:51", "key": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", "path": [ { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", - "value": [ - { - "string": "**", - "raw_string": "**" - } - ], - "pattern": [ - "*", - "", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", "value": [ { "string": "style", @@ -267,7 +629,7 @@ }, { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", "value": [ { "string": "fill", @@ -281,7 +643,7 @@ "primary": {}, "value": { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:15:44-2:18:47", + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", "value": [ { "string": "red", @@ -301,7 +663,7 @@ "references": [ { "string": { - "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", "value": [ { "string": "style", @@ -310,27 +672,11 @@ ] }, "key_path": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", "path": [ { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", - "value": [ - { - "string": "**", - "raw_string": "**" - } - ], - "pattern": [ - "*", - "", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", "value": [ { "string": "style", @@ -341,7 +687,7 @@ }, { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", "value": [ { "string": "fill", @@ -355,29 +701,13 @@ "context": { "edge": null, "key": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:18:47", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:22:51", "key": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:16:45", "path": [ { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31", - "value": [ - { - "string": "**", - "raw_string": "**" - } - ], - "pattern": [ - "*", - "", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37", + "range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40", "value": [ { "string": "style", @@ -388,7 +718,7 @@ }, { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:9:38-2:13:42", + "range": "TestCompile/patterns/double-glob.d2,2:12:41-2:16:45", "value": [ { "string": "fill", @@ -402,7 +732,7 @@ "primary": {}, "value": { "unquoted_string": { - "range": "TestCompile/patterns/double-glob.d2,2:15:44-2:18:47", + "range": "TestCompile/patterns/double-glob.d2,2:18:47-2:21:50", "value": [ { "string": "red", diff --git a/testdata/d2ir/TestCompile/patterns/double-glob/1.exp.json b/testdata/d2ir/TestCompile/patterns/double-glob/1.exp.json new file mode 100644 index 000000000..804f187d0 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/double-glob/1.exp.json @@ -0,0 +1,1095 @@ +{ + "fields": [ + { + "name": "shared", + "composite": { + "fields": [ + { + "name": "animate", + "composite": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "animal", + "composite": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:18:47", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:13:42", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:0:29-2:2:31", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:3:32-2:8:37", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:9:38-2:13:42", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,2:15:44-2:18:47", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:14:14", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:14:14", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,0:7:7-0:14:14", + "value": [ + { + "string": "animate", + "raw_string": "animate" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:13:28", + "key": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:13:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:0:15-1:6:21", + "value": [ + { + "string": "shared", + "raw_string": "shared" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/1.d2,1:7:22-1:13:28", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null +} From 0d2b0aa99c4f688f6a85c48de1110879e4a533f4 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Thu, 27 Jul 2023 02:51:43 -0700 Subject: [PATCH 05/15] d2ir: Implement edge index globs --- d2ir/compile.go | 2 +- d2ir/d2ir.go | 2 + d2ir/pattern_test.go | 15 + d2ir/query.go | 2 +- .../patterns/edge-glob-index.exp.json | 4003 +++++++++++++++++ 5 files changed, 4022 insertions(+), 2 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json diff --git a/d2ir/compile.go b/d2ir/compile.go index 962e1ec40..31ad34259 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -647,7 +647,7 @@ func (c *compiler) _compileEdges(refctx *RefContext) { refctx.Edge = refctx.Key.Edges[i] var ea []*Edge - if eid.Index != nil { + if eid.Index != nil || eid.Glob { ea = refctx.ScopeMap.GetEdges(eid) if len(ea) == 0 { c.errorf(refctx.Edge, "indexed edge does not exist") diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index 8ef67de0b..f460d59af 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -325,6 +325,7 @@ type EdgeID struct { // If nil, then any EdgeID with equal src/dst/arrows matches. Index *int `json:"index"` + Glob bool `json:"glob"` } func NewEdgeIDs(k *d2ast.Key) (eida []*EdgeID) { @@ -337,6 +338,7 @@ func NewEdgeIDs(k *d2ast.Key) (eida []*EdgeID) { } if k.EdgeIndex != nil { eid.Index = k.EdgeIndex.Int + eid.Glob = k.EdgeIndex.Glob } eida = append(eida, eid) } diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index 90e6dd35c..a9dc163ef 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -133,6 +133,21 @@ sh*.an* -> sh*.an*`) assertQuery(t, m, 0, 0, nil, "shared.(animal -> animal)[0]") }, }, + { + name: "edge-glob-index", + run: func(t testing.TB) { + m, err := compile(t, `a -> b +a -> b +a -> b +(a -> b)[*].style.fill: red +`) + assert.Success(t, err) + assertQuery(t, m, 8, 3, nil, "") + assertQuery(t, m, 0, 0, "red", "(a -> b)[0].style.fill") + assertQuery(t, m, 0, 0, "red", "(a -> b)[1].style.fill") + assertQuery(t, m, 0, 0, "red", "(a -> b)[2].style.fill") + }, + }, { name: "double-glob/1", run: func(t testing.TB) { diff --git a/d2ir/query.go b/d2ir/query.go index e70ad88df..e2ab2e944 100644 --- a/d2ir/query.go +++ b/d2ir/query.go @@ -56,7 +56,7 @@ func (m *Map) Query(idStr string) (Node, error) { return nil, nil } if len(na) > 1 { - return nil, fmt.Errorf("expected only one query result but got: %#v", err) + return nil, fmt.Errorf("expected only one query result but got: %#v", na) } return na[0], nil } diff --git a/testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json b/testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json new file mode 100644 index 000000000..71a40a308 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json @@ -0,0 +1,4003 @@ +{ + "fields": [ + { + "name": "a", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + }, + { + "name": "b", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 1, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 2, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:0:21-3:27:48", + "edges": [ + { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:7:28", + "src": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:1:22-3:2:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:6:27-3:7:28", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:8:29-3:11:32", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:22:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:12:33-3:17:38", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:18:39-3:22:43", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/edge-glob-index.d2,3:24:45-3:27:48", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ] +} From b119174a0964c9b76792af6e474140001e6aca31 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 29 Jul 2023 14:58:48 -0700 Subject: [PATCH 06/15] d2ir: Fix implementation of Map.createEdge --- d2ir/compile.go | 2 +- d2ir/d2ir.go | 50 +- .../nulls/basic/attribute.exp.json | 42 + .../nulls/implicit/delete-children.exp.json | 31 + .../nulls/reappear/children-reset.exp.json | 31 + .../d2ir/TestCompile/edges/chain.exp.json | 1113 +---------------- .../d2ir/TestCompile/edges/nested.exp.json | 663 +--------- testdata/d2ir/TestCompile/edges/root.exp.json | 223 +--- .../TestCompile/edges/underscore.exp.json | 418 +------ .../layers/errs/4/good_edge.exp.json | 399 +----- .../d2ir/TestCompile/layers/root.exp.json | 223 +--- .../patterns/edge-glob-index.exp.json | 660 ---------- .../d2ir/TestCompile/patterns/edge/1.exp.json | 12 +- .../d2ir/TestCompile/patterns/edge/2.exp.json | 12 +- .../d2ir/TestCompile/patterns/edge/3.exp.json | 12 +- .../d2ir/TestCompile/scenarios/edge.exp.json | 446 +------ .../d2ir/TestCompile/scenarios/root.exp.json | 669 +--------- .../d2ir/TestCompile/steps/recursive.exp.json | 892 +------------ testdata/d2ir/TestCompile/steps/root.exp.json | 669 +--------- 19 files changed, 189 insertions(+), 6378 deletions(-) diff --git a/d2ir/compile.go b/d2ir/compile.go index 31ad34259..9d97f5b6d 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -685,8 +685,8 @@ func (c *compiler) _compileEdges(refctx *RefContext) { e.Map_ = &Map{ parent: e, } - c.compileField(e.Map_, refctx.Key.EdgeKey, refctx) } + c.compileField(e.Map_, refctx.Key.EdgeKey, refctx) } else { if refctx.Key.Primary.Unbox() != nil { e.Primary_ = &Scalar{ diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index f460d59af..dbc3daa39 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -922,13 +922,6 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { return d2parser.Errorf(refctx.Edge.Src.Path[ij].Unbox(), "edge with board keyword alone doesn't make sense") } - srcStart := len(refctx.Edge.Src.Path) - len(eid.SrcPath) - if srcStart < 0 { - srcStart = 0 - } - srcKP := refctx.Edge.Src.Copy() - srcKP.Path = srcKP.Path[srcStart:] - ij = findProhibitedEdgeKeyword(eid.DstPath...) if ij != -1 { return d2parser.Errorf(refctx.Edge.Dst.Path[ij].Unbox(), "reserved keywords are prohibited in edges") @@ -938,37 +931,34 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { return d2parser.Errorf(refctx.Edge.Dst.Path[ij].Unbox(), "edge with board keyword alone doesn't make sense") } - dstStart := len(refctx.Edge.Dst.Path) - len(eid.DstPath) - if dstStart < 0 { - dstStart = 0 - } - dstKP := refctx.Edge.Dst.Copy() - dstKP.Path = dstKP.Path[dstStart:] - - underscoresCountSrc := 0 - underscoresCountDst := 0 - for _, el := range refctx.Edge.Src.Path { - if el.ScalarString() == "_" { - underscoresCountSrc++ + srcKP := d2ast.MakeKeyPath(eid.SrcPath) + lastMatch := 0 + for i, el := range srcKP.Path { + for j := lastMatch; j < len(refctx.Edge.Src.Path); j++ { + realEl := refctx.Edge.Src.Path[j] + if el.ScalarString() == realEl.ScalarString() { + srcKP.Path[i] = realEl + lastMatch += j + 1 + } } } - for _, el := range refctx.Edge.Dst.Path { - if el.ScalarString() == "_" { - underscoresCountDst++ + dstKP := d2ast.MakeKeyPath(eid.DstPath) + lastMatch = 0 + for i, el := range dstKP.Path { + for j := lastMatch; j < len(refctx.Edge.Dst.Path); j++ { + realEl := refctx.Edge.Dst.Path[j] + if el.ScalarString() == realEl.ScalarString() { + dstKP.Path[i] = realEl + lastMatch += j + 1 + } } } - for i := 0; i < underscoresCountDst; i++ { - srcKP.Path = append([]*d2ast.StringBox{d2ast.RawStringBox(eid.SrcPath[i], true)}, srcKP.Path...) - } - for i := 0; i < underscoresCountSrc; i++ { - dstKP.Path = append([]*d2ast.StringBox{d2ast.RawStringBox(eid.DstPath[i], true)}, dstKP.Path...) - } - srcFA, err := m.EnsureField(srcKP, refctx) + srcFA, err := m.EnsureField(srcKP, nil) if err != nil { return err } - dstFA, err := m.EnsureField(dstKP, refctx) + dstFA, err := m.EnsureField(dstKP, nil) if err != nil { return err } diff --git a/testdata/d2compiler/TestCompile2/nulls/basic/attribute.exp.json b/testdata/d2compiler/TestCompile2/nulls/basic/attribute.exp.json index 8b29a9497..fb4a47fbd 100644 --- a/testdata/d2compiler/TestCompile2/nulls/basic/attribute.exp.json +++ b/testdata/d2compiler/TestCompile2/nulls/basic/attribute.exp.json @@ -177,6 +177,48 @@ }, "key_path_index": 0, "map_key_edge_index": -1 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/basic/attribute.d2,2:0:22-2:15:37", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/basic/attribute.d2,2:0:22-2:1:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/basic/attribute.d2,2:2:24-2:7:29", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/basic/attribute.d2,2:8:30-2:15:37", + "value": [ + { + "string": "opacity", + "raw_string": "opacity" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 } ], "attributes": { diff --git a/testdata/d2compiler/TestCompile2/nulls/implicit/delete-children.exp.json b/testdata/d2compiler/TestCompile2/nulls/implicit/delete-children.exp.json index 7d93bdeea..758fbbabb 100644 --- a/testdata/d2compiler/TestCompile2/nulls/implicit/delete-children.exp.json +++ b/testdata/d2compiler/TestCompile2/nulls/implicit/delete-children.exp.json @@ -232,6 +232,37 @@ }, "key_path_index": 0, "map_key_edge_index": -1 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/implicit/delete-children.d2,5:0:22-5:3:25", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/implicit/delete-children.d2,5:0:22-5:1:23", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/implicit/delete-children.d2,5:2:24-5:3:25", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 } ], "attributes": { diff --git a/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.exp.json b/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.exp.json index 3e297fcec..6af8f1845 100644 --- a/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.exp.json +++ b/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.exp.json @@ -195,6 +195,37 @@ "key_path_index": 0, "map_key_edge_index": -1 }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.d2,2:0:7-2:3:10", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.d2,2:0:7-2:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.d2,2:2:9-2:3:10", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + }, { "key": { "range": "d2/testdata/d2compiler/TestCompile2/nulls/reappear/children-reset.d2,3:0:17-3:3:20", diff --git a/testdata/d2ir/TestCompile/edges/chain.exp.json b/testdata/d2ir/TestCompile/edges/chain.exp.json index 3708c3f1e..8484dbbdb 100644 --- a/testdata/d2ir/TestCompile/edges/chain.exp.json +++ b/testdata/d2ir/TestCompile/edges/chain.exp.json @@ -186,190 +186,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", - "edges": [ - { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -560,374 +376,6 @@ } } }, - { - "string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", - "edges": [ - { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, - { - "string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", - "edges": [ - { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", @@ -1301,374 +749,6 @@ } } }, - { - "string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", - "edges": [ - { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, - { - "string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", - "edges": [ - { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", @@ -2041,190 +1121,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:16:16", - "edges": [ - { - "range": "TestCompile/edges/chain.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:5:5-0:11:11", - "src": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - { - "range": "TestCompile/edges/chain.d2,0:10:10-0:16:16", - "src": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:10:10-0:11:11", - "value": [ - { - "string": "c", - "raw_string": "c" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/chain.d2,0:15:15-0:16:16", - "value": [ - { - "string": "d", - "raw_string": "d" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -2240,7 +1136,8 @@ "b" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -2414,7 +1311,8 @@ "c" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -2588,7 +1486,8 @@ "d" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/edges/nested.exp.json b/testdata/d2ir/TestCompile/edges/nested.exp.json index e49102cd2..548780974 100644 --- a/testdata/d2ir/TestCompile/edges/nested.exp.json +++ b/testdata/d2ir/TestCompile/edges/nested.exp.json @@ -171,171 +171,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "edges": [ - { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -507,171 +342,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "edges": [ - { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -846,171 +516,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "edges": [ - { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -1182,171 +687,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "edges": [ - { - "range": "TestCompile/edges/nested.d2,0:0:0-0:10:10", - "src": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:3:3", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:2:2-0:3:3", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:7:7-0:8:8", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/nested.d2,0:9:9-0:10:10", - "value": [ - { - "string": "p", - "raw_string": "p" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -1364,7 +704,8 @@ "p" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/edges/root.exp.json b/testdata/d2ir/TestCompile/edges/root.exp.json index 3938e435b..ec08bcf95 100644 --- a/testdata/d2ir/TestCompile/edges/root.exp.json +++ b/testdata/d2ir/TestCompile/edges/root.exp.json @@ -112,116 +112,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -337,116 +227,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/edges/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -462,7 +242,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/edges/underscore.exp.json b/testdata/d2ir/TestCompile/edges/underscore.exp.json index f97efdddb..066323086 100644 --- a/testdata/d2ir/TestCompile/edges/underscore.exp.json +++ b/testdata/d2ir/TestCompile/edges/underscore.exp.json @@ -138,148 +138,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": ",0:0:0-0:0:0", - "value": [ - { - "string": "p" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", - "src": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", - "value": [ - { - "string": "_", - "raw_string": "_" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:14:14", - "edges": [ - { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", - "src": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", - "value": [ - { - "string": "_", - "raw_string": "_" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -400,147 +258,6 @@ } } } - }, - { - "string": { - "range": ",0:0:0-0:0:0", - "value": [ - { - "string": "p" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": ",0:0:0-0:0:0", - "value": [ - { - "string": "p" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", - "src": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", - "value": [ - { - "string": "_", - "raw_string": "_" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:14:14", - "edges": [ - { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", - "src": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", - "value": [ - { - "string": "_", - "raw_string": "_" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -689,138 +406,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", - "src": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", - "value": [ - { - "string": "_", - "raw_string": "_" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:14:14", - "edges": [ - { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:13:13", - "src": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:8:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:5:5-0:6:6", - "value": [ - { - "string": "_", - "raw_string": "_" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/edges/underscore.d2,0:12:12-0:13:13", - "value": [ - { - "string": "z", - "raw_string": "z" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -837,7 +422,8 @@ "z" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json b/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json index 754264164..c18033088 100644 --- a/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json +++ b/testdata/d2ir/TestCompile/layers/errs/4/good_edge.exp.json @@ -450,402 +450,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", - "src": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", - "edges": [ - { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", - "src": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, - { - "string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", - "src": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", - "edges": [ - { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:24:24", - "src": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:10:10", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:0:0-0:6:6", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:7:7-0:8:8", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:9:9-0:10:10", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:24:24", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:14:14-0:20:20", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:21:21-0:22:22", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/layers/errs/4/good_edge.d2,0:23:23-0:24:24", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] } @@ -861,7 +465,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/layers/root.exp.json b/testdata/d2ir/TestCompile/layers/root.exp.json index 6c8ca2fa4..82ca928ad 100644 --- a/testdata/d2ir/TestCompile/layers/root.exp.json +++ b/testdata/d2ir/TestCompile/layers/root.exp.json @@ -112,116 +112,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -337,116 +227,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/layers/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/layers/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1025,7 +805,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json b/testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json index 71a40a308..8da87a6c9 100644 --- a/testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json +++ b/testdata/d2ir/TestCompile/patterns/edge-glob-index.exp.json @@ -113,116 +113,6 @@ } } }, - { - "string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - }, - "key_path": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", @@ -333,226 +223,6 @@ } } }, - { - "string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - }, - "key_path": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", - "edges": [ - { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, - { - "string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - }, - "key_path": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", - "edges": [ - { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", @@ -1234,116 +904,6 @@ } } }, - { - "string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - }, - "key_path": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", @@ -1454,226 +1014,6 @@ } } }, - { - "string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - }, - "key_path": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", - "edges": [ - { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:6:13", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:0:7-1:1:8", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,1:5:12-1:6:13", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, - { - "string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - }, - "key_path": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", - "edges": [ - { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:6:20", - "src": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:0:14-2:1:15", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/patterns/edge-glob-index.d2,2:5:19-2:6:20", diff --git a/testdata/d2ir/TestCompile/patterns/edge/1.exp.json b/testdata/d2ir/TestCompile/patterns/edge/1.exp.json index dff85c37a..6e38e272d 100644 --- a/testdata/d2ir/TestCompile/patterns/edge/1.exp.json +++ b/testdata/d2ir/TestCompile/patterns/edge/1.exp.json @@ -124,7 +124,8 @@ "animate" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -240,7 +241,8 @@ "animal" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -356,7 +358,8 @@ "animate" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -472,7 +475,8 @@ "animal" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/patterns/edge/2.exp.json b/testdata/d2ir/TestCompile/patterns/edge/2.exp.json index b5d8b16a5..95a956c07 100644 --- a/testdata/d2ir/TestCompile/patterns/edge/2.exp.json +++ b/testdata/d2ir/TestCompile/patterns/edge/2.exp.json @@ -172,7 +172,8 @@ "animate" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -308,7 +309,8 @@ "animal" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -444,7 +446,8 @@ "animate" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -580,7 +583,8 @@ "animal" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/patterns/edge/3.exp.json b/testdata/d2ir/TestCompile/patterns/edge/3.exp.json index 7f8948ac4..3316812a8 100644 --- a/testdata/d2ir/TestCompile/patterns/edge/3.exp.json +++ b/testdata/d2ir/TestCompile/patterns/edge/3.exp.json @@ -172,7 +172,8 @@ "animate" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -348,7 +349,8 @@ "animal" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -524,7 +526,8 @@ "animate" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -700,7 +703,8 @@ "animal" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/scenarios/edge.exp.json b/testdata/d2ir/TestCompile/scenarios/edge.exp.json index 7bfb0dce9..c0ef78879 100644 --- a/testdata/d2ir/TestCompile/scenarios/edge.exp.json +++ b/testdata/d2ir/TestCompile/scenarios/edge.exp.json @@ -112,116 +112,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -337,116 +227,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -571,116 +351,6 @@ } } }, - { - "string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/scenarios/edge.d2,3:5:32-3:6:33", @@ -944,116 +614,6 @@ } } }, - { - "string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:0:0-0:1:1", - "value": [ - { - "string": "a", - "raw_string": "a" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/edge.d2,0:5:5-0:6:6", - "value": [ - { - "string": "b", - "raw_string": "b" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - }, { "string": { "range": "TestCompile/scenarios/edge.d2,3:10:37-3:11:38", @@ -1216,7 +776,8 @@ "b" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "map": { "fields": [ @@ -2108,7 +1669,8 @@ "b" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/scenarios/root.exp.json b/testdata/d2ir/TestCompile/scenarios/root.exp.json index 31100d590..0c7ae1e33 100644 --- a/testdata/d2ir/TestCompile/scenarios/root.exp.json +++ b/testdata/d2ir/TestCompile/scenarios/root.exp.json @@ -112,116 +112,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -337,116 +227,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -570,116 +350,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -795,116 +465,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1230,7 +790,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -1543,116 +1104,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1768,116 +1219,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/scenarios/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1949,7 +1290,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -2325,7 +1667,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/steps/recursive.exp.json b/testdata/d2ir/TestCompile/steps/recursive.exp.json index f92eec4b9..bcaeb4be0 100644 --- a/testdata/d2ir/TestCompile/steps/recursive.exp.json +++ b/testdata/d2ir/TestCompile/steps/recursive.exp.json @@ -112,116 +112,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -337,116 +227,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -570,116 +350,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -795,116 +465,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1230,7 +790,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -1543,116 +1104,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1768,116 +1219,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -2367,116 +1708,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -2592,116 +1823,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/recursive.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -3139,7 +2260,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -3441,7 +2563,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -3979,7 +3102,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { diff --git a/testdata/d2ir/TestCompile/steps/root.exp.json b/testdata/d2ir/TestCompile/steps/root.exp.json index 51f9d002c..a8b486f76 100644 --- a/testdata/d2ir/TestCompile/steps/root.exp.json +++ b/testdata/d2ir/TestCompile/steps/root.exp.json @@ -112,116 +112,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -337,116 +227,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -570,116 +350,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -795,116 +465,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1230,7 +790,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -1543,116 +1104,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -1768,116 +1219,6 @@ "value": {} } } - }, - { - "string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - }, - "key_path": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "context": { - "edge": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "edges": [ - { - "range": "TestCompile/steps/root.d2,0:0:0-0:6:6", - "src": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:0:0-0:1:1", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/steps/root.d2,0:5:5-0:6:6", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } } ] }, @@ -2259,7 +1600,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { @@ -2635,7 +1977,8 @@ "y" ], "dst_arrow": true, - "index": 0 + "index": 0, + "glob": false }, "references": [ { From 95667750e0e444cec6d00b1376b5c292652960a6 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 29 Jul 2023 16:16:05 -0700 Subject: [PATCH 07/15] d2ir: Fix and add test for glob-edge-glob-index --- d2ir/compile.go | 10 +- d2ir/d2ir.go | 136 +- d2ir/merge.go | 2 +- d2ir/pattern_test.go | 29 +- d2ir/query.go | 2 +- .../errors/glob-edge-glob-index.exp.json | 667 +++ .../patterns/glob-edge-glob-index.exp.json | 3945 +++++++++++++++++ 7 files changed, 4766 insertions(+), 25 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/errors/glob-edge-glob-index.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/glob-edge-glob-index.exp.json diff --git a/d2ir/compile.go b/d2ir/compile.go index 9d97f5b6d..c2bff5f55 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -396,7 +396,7 @@ func (c *compiler) compileKey(refctx *RefContext) { } func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) { - fa, err := dst.EnsureField(kp, refctx) + fa, err := dst.EnsureField(kp, refctx, true) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) return @@ -614,7 +614,7 @@ func (c *compiler) compileEdges(refctx *RefContext) { return } - fa, err := refctx.ScopeMap.EnsureField(refctx.Key.Key, refctx) + fa, err := refctx.ScopeMap.EnsureField(refctx.Key.Key, refctx, true) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) return @@ -648,7 +648,7 @@ func (c *compiler) _compileEdges(refctx *RefContext) { var ea []*Edge if eid.Index != nil || eid.Glob { - ea = refctx.ScopeMap.GetEdges(eid) + ea = refctx.ScopeMap.GetEdges(eid, refctx) if len(ea) == 0 { c.errorf(refctx.Edge, "indexed edge does not exist") continue @@ -661,12 +661,12 @@ func (c *compiler) _compileEdges(refctx *RefContext) { refctx.ScopeMap.appendFieldReferences(0, refctx.Edge.Dst, refctx) } } else { - _, err := refctx.ScopeMap.EnsureField(refctx.Edge.Src, refctx) + _, err := refctx.ScopeMap.EnsureField(refctx.Edge.Src, refctx, true) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) continue } - _, err = refctx.ScopeMap.EnsureField(refctx.Edge.Dst, refctx) + _, err = refctx.ScopeMap.EnsureField(refctx.Edge.Dst, refctx, true) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) continue diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index dbc3daa39..531237b05 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -653,7 +653,7 @@ func (m *Map) getField(ida []string) *Field { return nil } -func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext) ([]*Field, error) { +func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext, create bool) ([]*Field, error) { i := 0 for kp.Path[i].Unbox().ScalarString() == "_" { m = ParentMap(m) @@ -667,11 +667,11 @@ func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext) ([]*Field, erro } var fa []*Field - err := m.ensureField(i, kp, refctx, &fa) + err := m.ensureField(i, kp, refctx, create, &fa) return fa, err } -func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*Field) error { +func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, create bool, fa *[]*Field) error { us, ok := kp.Path[i].Unbox().(*d2ast.UnquotedString) if ok && us.Pattern != nil { fa2, ok := m.doubleGlob(us.Pattern) @@ -685,7 +685,7 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*F parent: f, } } - err := f.Map().ensureField(i+1, kp, refctx, fa) + err := f.Map().ensureField(i+1, kp, refctx, create, fa) if err != nil { return err } @@ -703,7 +703,7 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*F parent: f, } } - err := f.Map().ensureField(i+1, kp, refctx, fa) + err := f.Map().ensureField(i+1, kp, refctx, create, fa) if err != nil { return err } @@ -760,9 +760,12 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*F parent: f, } } - return f.Map().ensureField(i+1, kp, refctx, fa) + return f.Map().ensureField(i+1, kp, refctx, create, fa) } + if !create { + return nil + } f := &Field{ parent: m, Name: head, @@ -783,7 +786,7 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*F f.Composite = &Map{ parent: f, } - return f.Map().ensureField(i+1, kp, refctx, fa) + return f.Map().ensureField(i+1, kp, refctx, create, fa) } func (m *Map) DeleteEdge(eid *EdgeID) *Edge { @@ -848,7 +851,13 @@ func (m *Map) DeleteField(ida ...string) *Field { return nil } -func (m *Map) GetEdges(eid *EdgeID) []*Edge { +func (m *Map) GetEdges(eid *EdgeID, refctx *RefContext) []*Edge { + if refctx != nil { + var ea []*Edge + m.getEdges(eid, refctx, &ea) + return ea + } + eid, m, common, err := eid.resolve(m) if err != nil { return nil @@ -859,7 +868,7 @@ func (m *Map) GetEdges(eid *EdgeID) []*Edge { return nil } if f.Map() != nil { - return f.Map().GetEdges(eid) + return f.Map().GetEdges(eid, nil) } return nil } @@ -873,6 +882,90 @@ func (m *Map) GetEdges(eid *EdgeID) []*Edge { return ea } +func (m *Map) getEdges(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { + eid, m, common, err := eid.resolve(m) + if err != nil { + return err + } + + if len(common) > 0 { + commonKP := d2ast.MakeKeyPath(common) + lastMatch := 0 + for i, el := range commonKP.Path { + for j := lastMatch; j < len(refctx.Edge.Src.Path); j++ { + realEl := refctx.Edge.Src.Path[j] + if el.ScalarString() == realEl.ScalarString() { + commonKP.Path[i] = realEl + lastMatch += j + 1 + } + } + } + fa, err := m.EnsureField(commonKP, nil, false) + if err != nil { + return nil + } + for _, f := range fa { + if _, ok := f.Composite.(*Array); ok { + return d2parser.Errorf(refctx.Edge.Src, "cannot index into array") + } + if f.Map() == nil { + f.Composite = &Map{ + parent: f, + } + } + err = f.Map().getEdges(eid, refctx, ea) + if err != nil { + return err + } + } + return nil + } + + srcKP := d2ast.MakeKeyPath(eid.SrcPath) + lastMatch := 0 + for i, el := range srcKP.Path { + for j := lastMatch; j < len(refctx.Edge.Src.Path); j++ { + realEl := refctx.Edge.Src.Path[j] + if el.ScalarString() == realEl.ScalarString() { + srcKP.Path[i] = realEl + lastMatch += j + 1 + } + } + } + dstKP := d2ast.MakeKeyPath(eid.DstPath) + lastMatch = 0 + for i, el := range dstKP.Path { + for j := lastMatch; j < len(refctx.Edge.Dst.Path); j++ { + realEl := refctx.Edge.Dst.Path[j] + if el.ScalarString() == realEl.ScalarString() { + dstKP.Path[i] = realEl + lastMatch += j + 1 + } + } + } + + srcFA, err := m.EnsureField(srcKP, nil, false) + if err != nil { + return err + } + dstFA, err := m.EnsureField(dstKP, nil, false) + if err != nil { + return err + } + + for _, src := range srcFA { + for _, dst := range dstFA { + eid2 := eid.Copy() + eid2.SrcPath = RelIDA(m, src) + eid2.DstPath = RelIDA(m, dst) + + ea2 := m.GetEdges(eid2, nil) + *ea = append(*ea, ea2...) + } + } + return nil +} + func (m *Map) CreateEdge(eid *EdgeID, refctx *RefContext) ([]*Edge, error) { var ea []*Edge return ea, m.createEdge(eid, refctx, &ea) @@ -888,11 +981,18 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { return d2parser.Errorf(refctx.Edge, err.Error()) } if len(common) > 0 { - commonEnd := len(refctx.Edge.Src.Path) - len(eid.SrcPath) - commonStart := commonEnd - len(common) - commonKP := refctx.Edge.Src.Copy() - commonKP.Path = commonKP.Path[commonStart:commonEnd] - fa, err := m.EnsureField(commonKP, nil) + commonKP := d2ast.MakeKeyPath(common) + lastMatch := 0 + for i, el := range commonKP.Path { + for j := lastMatch; j < len(refctx.Edge.Src.Path); j++ { + realEl := refctx.Edge.Src.Path[j] + if el.ScalarString() == realEl.ScalarString() { + commonKP.Path[i] = realEl + lastMatch += j + 1 + } + } + } + fa, err := m.EnsureField(commonKP, nil, true) if err != nil { return err } @@ -954,11 +1054,11 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { } } - srcFA, err := m.EnsureField(srcKP, nil) + srcFA, err := m.EnsureField(srcKP, nil, true) if err != nil { return err } - dstFA, err := m.EnsureField(dstKP, nil) + dstFA, err := m.EnsureField(dstKP, nil, true) if err != nil { return err } @@ -990,9 +1090,11 @@ func (m *Map) createEdge2(eid *EdgeID, refctx *RefContext, src, dst *Field) (*Ed } eid.Index = nil - ea := m.GetEdges(eid) + eid.Glob = true + ea := m.GetEdges(eid, refctx) index := len(ea) eid.Index = &index + eid.Glob = false e := &Edge{ parent: m, ID: eid, diff --git a/d2ir/merge.go b/d2ir/merge.go index 15ba2a9ec..a4a30d21f 100644 --- a/d2ir/merge.go +++ b/d2ir/merge.go @@ -11,7 +11,7 @@ func OverlayMap(base, overlay *Map) { } for _, oe := range overlay.Edges { - bea := base.GetEdges(oe.ID) + bea := base.GetEdges(oe.ID, nil) if len(bea) == 0 { base.Edges = append(base.Edges, oe.Copy(base).(*Edge)) continue diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index a9dc163ef..bae678f4a 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -148,6 +148,23 @@ a -> b assertQuery(t, m, 0, 0, "red", "(a -> b)[2].style.fill") }, }, + { + name: "glob-edge-glob-index", + run: func(t testing.TB) { + m, err := compile(t, `a -> b +a -> b +a -> b +c -> b +(* -> b)[*].style.fill: red +`) + assert.Success(t, err) + assertQuery(t, m, 11, 4, nil, "") + assertQuery(t, m, 0, 0, "red", "(a -> b)[0].style.fill") + assertQuery(t, m, 0, 0, "red", "(a -> b)[1].style.fill") + assertQuery(t, m, 0, 0, "red", "(a -> b)[2].style.fill") + assertQuery(t, m, 0, 0, "red", "(c -> b)[0].style.fill") + }, + }, { name: "double-glob/1", run: func(t testing.TB) { @@ -169,7 +186,17 @@ shared.animal runa(t, tca) t.Run("errors", func(t *testing.T) { - tca := []testCase{} + tca := []testCase{ + { + name: "glob-edge-glob-index", + run: func(t testing.TB) { + m, err := compile(t, `(* -> b)[*].style.fill: red +`) + assert.ErrorString(t, err, `TestCompile/patterns/errors/glob-edge-glob-index.d2:1:2: indexed edge does not exist`) + assertQuery(t, m, 0, 0, nil, "") + }, + }, + } runa(t, tca) }) } diff --git a/d2ir/query.go b/d2ir/query.go index e2ab2e944..0f7caddc9 100644 --- a/d2ir/query.go +++ b/d2ir/query.go @@ -30,7 +30,7 @@ func (m *Map) QueryAll(idStr string) (na []Node, _ error) { eida := NewEdgeIDs(k) for _, eid := range eida { - ea := m.GetEdges(eid) + ea := m.GetEdges(eid, nil) for _, e := range ea { if k.EdgeKey == nil { na = append(na, e) diff --git a/testdata/d2ir/TestCompile/patterns/errors/glob-edge-glob-index.exp.json b/testdata/d2ir/TestCompile/patterns/errors/glob-edge-glob-index.exp.json new file mode 100644 index 000000000..9735275e6 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/errors/glob-edge-glob-index.exp.json @@ -0,0 +1,667 @@ +{ + "fields": [ + { + "name": "b", + "references": [ + { + "string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:0:0-0:24:24", + "edges": [ + { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:19:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:14:14", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:15:15-0:19:19", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:21:21-0:24:24", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "b" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:21:21-0:24:24", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:15:15-0:19:19", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:19:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:14:14", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:15:15-0:19:19", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:0:0-0:24:24", + "edges": [ + { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:19:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:14:14", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:15:15-0:19:19", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:21:21-0:24:24", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:14:14", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:19:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:14:14", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:15:15-0:19:19", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:0:0-0:24:24", + "edges": [ + { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:19:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:14:14", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:15:15-0:19:19", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:21:21-0:24:24", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:0:0-0:24:24", + "edges": [ + { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:7:7", + "src": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:1:1-0:2:2", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:6:6-0:7:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_key": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:19:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:9:9-0:14:14", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:15:15-0:19:19", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/errors/glob-edge-glob-index.d2,0:21:21-0:24:24", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ] +} diff --git a/testdata/d2ir/TestCompile/patterns/glob-edge-glob-index.exp.json b/testdata/d2ir/TestCompile/patterns/glob-edge-glob-index.exp.json new file mode 100644 index 000000000..76ba3598f --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/glob-edge-glob-index.exp.json @@ -0,0 +1,3945 @@ +{ + "fields": [ + { + "name": "a", + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "b", + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + }, + { + "name": "c", + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:6:6", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,0:5:5-0:6:6", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 1, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:6:13", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:0:7-1:1:8", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,1:5:12-1:6:13", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 2, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:6:20", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:0:14-2:1:15", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,2:5:19-2:6:20", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "c" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "map": { + "fields": [ + { + "name": "style", + "composite": { + "fields": [ + { + "name": "fill", + "primary": { + "value": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:6:27", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:0:21-3:1:22", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,3:5:26-3:6:27", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + }, + { + "context": { + "edge": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:0:28-4:27:55", + "edges": [ + { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:7:35", + "src": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:1:29-4:2:30", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:6:34-4:7:35", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "edge_index": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:8:36-4:11:39", + "int": null, + "glob": true + }, + "edge_key": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:22:50", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:12:40-4:17:45", + "value": [ + { + "string": "style", + "raw_string": "style" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:18:46-4:22:50", + "value": [ + { + "string": "fill", + "raw_string": "fill" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/glob-edge-glob-index.d2,4:24:52-4:27:55", + "value": [ + { + "string": "red", + "raw_string": "red" + } + ] + } + } + } + } + } + ] + } + ] +} From ff47a00abf404990042797c83ab2b16871ab45cb Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 29 Jul 2023 16:43:22 -0700 Subject: [PATCH 08/15] d2ir: Make globs case insensitive to match the rest of the language note: I personally wish to change the language and make it case sensitive. --- d2ir/pattern.go | 2 +- d2ir/pattern_test.go | 12 ++ .../d2ir/TestCompile/patterns/case.exp.json | 159 ++++++++++++++++++ 3 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 testdata/d2ir/TestCompile/patterns/case.exp.json diff --git a/d2ir/pattern.go b/d2ir/pattern.go index 90773cca3..c2ccf237c 100644 --- a/d2ir/pattern.go +++ b/d2ir/pattern.go @@ -44,7 +44,7 @@ func matchPattern(s string, pattern []string) bool { i++ } } else { - if !strings.HasPrefix(s, pattern[i]) { + if !strings.HasPrefix(strings.ToLower(s), strings.ToLower(pattern[i])) { return false } s = s[len(pattern[i]):] diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index bae678f4a..ff91934d8 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -35,6 +35,18 @@ a*: globbed`) assertQuery(t, m, 0, 0, "globbed", "action") }, }, + { + name: "case", + run: func(t testing.TB) { + m, err := compile(t, `animal: meow +action: yes +A*: globbed`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "") + assertQuery(t, m, 0, 0, "globbed", "animal") + assertQuery(t, m, 0, 0, "globbed", "action") + }, + }, { name: "suffix", run: func(t testing.TB) { diff --git a/testdata/d2ir/TestCompile/patterns/case.exp.json b/testdata/d2ir/TestCompile/patterns/case.exp.json new file mode 100644 index 000000000..4c0ba1765 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/case.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "animal", + "primary": { + "value": { + "range": "TestCompile/patterns/case.d2,2:4:29-2:11:36", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/case.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/case.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/case.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/patterns/case.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/case.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "action", + "primary": { + "value": { + "range": "TestCompile/patterns/case.d2,2:4:29-2:11:36", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/case.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/case.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/case.d2,1:0:13-1:11:24", + "key": { + "range": "TestCompile/patterns/case.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/case.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} From 82663f044526524bd23567f742c873b44ec17c43 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 29 Jul 2023 16:45:30 -0700 Subject: [PATCH 09/15] d2ir: Explain EnsureField misnomer --- d2ir/d2ir.go | 1 + 1 file changed, 1 insertion(+) diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index 531237b05..53bb5a499 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -653,6 +653,7 @@ func (m *Map) getField(ida []string) *Field { return nil } +// EnsureField is a bit of a misnomer. It's more of a Query/Ensure combination function at this point. func (m *Map) EnsureField(kp *d2ast.KeyPath, refctx *RefContext, create bool) ([]*Field, error) { i := 0 for kp.Path[i].Unbox().ScalarString() == "_" { From 63efa1216070a31c4d0ee0e3dbd6abd71a93fc47 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 29 Jul 2023 16:54:44 -0700 Subject: [PATCH 10/15] d2ir: Fix globs to not match reserved --- d2ir/compile_test.go | 22 +- d2ir/pattern.go | 3 + d2ir/pattern_test.go | 19 + d2ir/query.go | 10 +- .../TestCompile/patterns/reserved.exp.json | 1686 +++++++++++++++++ 5 files changed, 1729 insertions(+), 11 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/reserved.exp.json diff --git a/d2ir/compile_test.go b/d2ir/compile_test.go index f29b45c27..61b1f49a6 100644 --- a/d2ir/compile_test.go +++ b/d2ir/compile_test.go @@ -85,23 +85,27 @@ func assertQuery(t testing.TB, n d2ir.Node, nfields, nedges int, primary interfa m := n.Map() p := n.Primary() + var na []d2ir.Node if idStr != "" { var err error - n, err = m.Query(idStr) + na, err = m.QueryAll(idStr) assert.Success(t, err) assert.NotEqual(t, n, nil) + } else { + na = append(na, n) + } - p = n.Primary() + for _, n := range na { m = n.Map() + p = n.Primary() + assert.Equal(t, nfields, m.FieldCountRecursive()) + assert.Equal(t, nedges, m.EdgeCountRecursive()) + if !makeScalar(p).Equal(makeScalar(primary)) { + t.Fatalf("expected primary %#v but got %s", primary, p) + } } - assert.Equal(t, nfields, m.FieldCountRecursive()) - assert.Equal(t, nedges, m.EdgeCountRecursive()) - if !makeScalar(p).Equal(makeScalar(primary)) { - t.Fatalf("expected primary %#v but got %s", primary, p) - } - - return n + return na[0] } func makeScalar(v interface{}) *d2ir.Scalar { diff --git a/d2ir/pattern.go b/d2ir/pattern.go index c2ccf237c..8118fb113 100644 --- a/d2ir/pattern.go +++ b/d2ir/pattern.go @@ -31,6 +31,9 @@ func matchPattern(s string, pattern []string) bool { if len(pattern) == 0 { return true } + if _, ok := d2graph.ReservedKeywords[s]; ok { + return false + } for i := 0; i < len(pattern); i++ { if pattern[i] == "*" { diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index ff91934d8..cfecbb7e1 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -193,6 +193,25 @@ shared.animal assertQuery(t, m, 1, 0, nil, "shared.animal.style") }, }, + { + name: "reserved", + run: func(t testing.TB) { + m, err := compile(t, `vars: { + d2-config: { + layout-engine: elk + } +} + +Spiderman 1 +Spiderman 2 +Spiderman 3 + +* -> *: arrow`) + assert.Success(t, err) + assertQuery(t, m, 6, 9, nil, "") + assertQuery(t, m, 0, 0, "arrow", "(* -> *)[*]") + }, + }, } runa(t, tca) diff --git a/d2ir/query.go b/d2ir/query.go index 0f7caddc9..8534d53e5 100644 --- a/d2ir/query.go +++ b/d2ir/query.go @@ -29,8 +29,14 @@ func (m *Map) QueryAll(idStr string) (na []Node, _ error) { } eida := NewEdgeIDs(k) - for _, eid := range eida { - ea := m.GetEdges(eid, nil) + + for i, eid := range eida { + refctx := &RefContext{ + Key: k, + ScopeMap: m, + Edge: k.Edges[i], + } + ea := m.GetEdges(eid, refctx) for _, e := range ea { if k.EdgeKey == nil { na = append(na, e) diff --git a/testdata/d2ir/TestCompile/patterns/reserved.exp.json b/testdata/d2ir/TestCompile/patterns/reserved.exp.json new file mode 100644 index 000000000..091efd0df --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/reserved.exp.json @@ -0,0 +1,1686 @@ +{ + "fields": [ + { + "name": "vars", + "composite": { + "fields": [ + { + "name": "d2-config", + "composite": { + "fields": [ + { + "name": "layout-engine", + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:22:45", + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-3:3:49", + "key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/reserved.d2,1:13:21-3:3:49", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:22:45", + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + } + } + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-4:1:51", + "key": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,0:0:0-0:4:4", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/reserved.d2,0:6:6-4:1:51", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-3:3:49", + "key": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,1:2:10-1:11:19", + "value": [ + { + "string": "d2-config", + "raw_string": "d2-config" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/reserved.d2,1:13:21-3:3:49", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:22:45", + "key": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:4:27-2:17:40", + "value": [ + { + "string": "layout-engine", + "raw_string": "layout-engine" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,2:19:42-2:22:45", + "value": [ + { + "string": "elk", + "raw_string": "elk" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + } + ] + }, + { + "name": "Spiderman 1", + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "value": [ + { + "string": "Spiderman 1", + "raw_string": "Spiderman 1" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "value": [ + { + "string": "Spiderman 1", + "raw_string": "Spiderman 1" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "key": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,6:0:53-6:11:64", + "value": [ + { + "string": "Spiderman 1", + "raw_string": "Spiderman 1" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "Spiderman 2", + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "value": [ + { + "string": "Spiderman 2", + "raw_string": "Spiderman 2" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "value": [ + { + "string": "Spiderman 2", + "raw_string": "Spiderman 2" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "key": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,7:0:65-7:11:76", + "value": [ + { + "string": "Spiderman 2", + "raw_string": "Spiderman 2" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "Spiderman 3", + "references": [ + { + "string": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "value": [ + { + "string": "Spiderman 3", + "raw_string": "Spiderman 3" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "value": [ + { + "string": "Spiderman 3", + "raw_string": "Spiderman 3" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "key": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,8:0:77-8:11:88", + "value": [ + { + "string": "Spiderman 3", + "raw_string": "Spiderman 3" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "Spiderman 1" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 1" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 1" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 2" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 1" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 3" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 2" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 1" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 2" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 2" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 2" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 3" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 3" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 1" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 3" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 2" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "Spiderman 3" + ], + "src_arrow": false, + "dst_path": [ + "Spiderman 3" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "primary": { + "value": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", + "edges": [ + { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", + "src": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", + "value": [ + { + "string": "arrow", + "raw_string": "arrow" + } + ] + } + } + } + } + } + ] + } + ] +} From bd2c94f7a8ea2ec17aa9d1c41473d9dfa4333683 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 29 Jul 2023 21:33:41 -0700 Subject: [PATCH 11/15] d2ir: Make suffix globs case insensitive too --- d2ir/pattern.go | 2 +- d2ir/pattern_test.go | 14 +- .../d2ir/TestCompile/patterns/case/1.exp.json | 159 ++++++++++++++++++ .../d2ir/TestCompile/patterns/case/2.exp.json | 139 +++++++++++++++ 4 files changed, 312 insertions(+), 2 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/case/1.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/case/2.exp.json diff --git a/d2ir/pattern.go b/d2ir/pattern.go index 8118fb113..067f629e0 100644 --- a/d2ir/pattern.go +++ b/d2ir/pattern.go @@ -39,7 +39,7 @@ func matchPattern(s string, pattern []string) bool { if pattern[i] == "*" { // * so match next. if i != len(pattern)-1 { - j := strings.Index(s, pattern[i+1]) + j := strings.Index(strings.ToLower(s), strings.ToLower(pattern[i+1])) if j == -1 { return false } diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index cfecbb7e1..fdcd53af9 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -36,7 +36,7 @@ a*: globbed`) }, }, { - name: "case", + name: "case/1", run: func(t testing.TB) { m, err := compile(t, `animal: meow action: yes @@ -47,6 +47,18 @@ A*: globbed`) assertQuery(t, m, 0, 0, "globbed", "action") }, }, + { + name: "case/2", + run: func(t testing.TB) { + m, err := compile(t, `diddy kong +Donkey Kong +*kong: yes`) + assert.Success(t, err) + assertQuery(t, m, 2, 0, nil, "") + assertQuery(t, m, 0, 0, "yes", "diddy kong") + assertQuery(t, m, 0, 0, "yes", "Donkey Kong") + }, + }, { name: "suffix", run: func(t testing.TB) { diff --git a/testdata/d2ir/TestCompile/patterns/case/1.exp.json b/testdata/d2ir/TestCompile/patterns/case/1.exp.json new file mode 100644 index 000000000..292d5d24e --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/case/1.exp.json @@ -0,0 +1,159 @@ +{ + "fields": [ + { + "name": "animal", + "primary": { + "value": { + "range": "TestCompile/patterns/case/1.d2,2:4:29-2:11:36", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/case/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/case/1.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/case/1.d2,0:0:0-0:12:12", + "key": { + "range": "TestCompile/patterns/case/1.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/1.d2,0:0:0-0:6:6", + "value": [ + { + "string": "animal", + "raw_string": "animal" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/case/1.d2,0:8:8-0:12:12", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + } + } + } + ] + }, + { + "name": "action", + "primary": { + "value": { + "range": "TestCompile/patterns/case/1.d2,2:4:29-2:11:36", + "value": [ + { + "string": "globbed", + "raw_string": "globbed" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/case/1.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/case/1.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/1.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/case/1.d2,1:0:13-1:11:24", + "key": { + "range": "TestCompile/patterns/case/1.d2,1:0:13-1:6:19", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/1.d2,1:0:13-1:6:19", + "value": [ + { + "string": "action", + "raw_string": "action" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "TestCompile/patterns/case/1.d2,1:8:21-1:11:24", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + } + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/case/2.exp.json b/testdata/d2ir/TestCompile/patterns/case/2.exp.json new file mode 100644 index 000000000..283008b8a --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/case/2.exp.json @@ -0,0 +1,139 @@ +{ + "fields": [ + { + "name": "diddy kong", + "primary": { + "value": { + "range": "TestCompile/patterns/case/2.d2,2:7:30-2:10:33", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/case/2.d2,0:0:0-0:10:10", + "value": [ + { + "string": "diddy kong", + "raw_string": "diddy kong" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/case/2.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/2.d2,0:0:0-0:10:10", + "value": [ + { + "string": "diddy kong", + "raw_string": "diddy kong" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/case/2.d2,0:0:0-0:10:10", + "key": { + "range": "TestCompile/patterns/case/2.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/2.d2,0:0:0-0:10:10", + "value": [ + { + "string": "diddy kong", + "raw_string": "diddy kong" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "Donkey Kong", + "primary": { + "value": { + "range": "TestCompile/patterns/case/2.d2,2:7:30-2:10:33", + "value": [ + { + "string": "yes", + "raw_string": "yes" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/case/2.d2,1:0:11-1:11:22", + "value": [ + { + "string": "Donkey Kong", + "raw_string": "Donkey Kong" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/case/2.d2,1:0:11-1:11:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/2.d2,1:0:11-1:11:22", + "value": [ + { + "string": "Donkey Kong", + "raw_string": "Donkey Kong" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/case/2.d2,1:0:11-1:11:22", + "key": { + "range": "TestCompile/patterns/case/2.d2,1:0:11-1:11:22", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/case/2.d2,1:0:11-1:11:22", + "value": [ + { + "string": "Donkey Kong", + "raw_string": "Donkey Kong" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null +} From 73e4e68fb8c6aa2ac5a36bd5b397959b536fd396 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 29 Jul 2023 21:38:27 -0700 Subject: [PATCH 12/15] changelogs/next.md: Update --- ci/release/changelogs/next.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index b7032e194..4a15bc469 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -9,6 +9,7 @@ Layout capability also takes a subtle but important step forward: you can now cu - Scale renders and disable fit to screen with `--scale` flag [#1413](https://github.com/terrastruct/d2/pull/1413) - `null` keyword can be used to un-declare. See [docs](https://d2lang.com/tour/overrides#null) [#1446](https://github.com/terrastruct/d2/pull/1446) - Develop multi-board diagrams in watch mode (links to layers/scenarios/steps work in `--watch`) [#1503](https://github.com/terrastruct/d2/pull/1503) +- Glob patterns have been implemented. See [docs](https://d2lang.com/tour/globs). [#1479](https://github.com/terrastruct/d2/pull/1479) #### Improvements 🧹 From 9c37d6dcfb0499e31218a17e13a8e0783c8f6137 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sun, 30 Jul 2023 01:15:34 -0700 Subject: [PATCH 13/15] d2ir: Make globs more ergonomic in two specific edge cases Were identified from @alixander writing documentation. --- d2ir/compile_test.go | 4 + d2ir/d2ir.go | 25 + d2ir/pattern_test.go | 47 +- .../double-glob/edge-no-container.exp.json | 1161 +++++++++++++++++ .../TestCompile/patterns/edge-nexus.exp.json | 779 +++++++++++ .../d2ir/TestCompile/patterns/edge/1.exp.json | 234 ---- .../d2ir/TestCompile/patterns/edge/2.exp.json | 274 ---- .../d2ir/TestCompile/patterns/edge/3.exp.json | 354 ----- .../TestCompile/patterns/reserved.exp.json | 402 ------ 9 files changed, 2009 insertions(+), 1271 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/double-glob/edge-no-container.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/edge-nexus.exp.json diff --git a/d2ir/compile_test.go b/d2ir/compile_test.go index 61b1f49a6..64d16ad8d 100644 --- a/d2ir/compile_test.go +++ b/d2ir/compile_test.go @@ -105,6 +105,10 @@ func assertQuery(t testing.TB, n d2ir.Node, nfields, nedges int, primary interfa } } + if len(na) == 0 { + return nil + } + return na[0] } diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index 53bb5a499..531eaea56 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -587,6 +587,19 @@ func (m *Map) FieldCountRecursive() int { return acc } +func (m *Map) IsContainer() bool { + if m == nil { + return false + } + for _, f := range m.Fields { + _, isReserved := d2graph.ReservedKeywords[f.Name] + if !isReserved { + return true + } + } + return false +} + func (m *Map) EdgeCountRecursive() int { if m == nil { return 0 @@ -1066,6 +1079,18 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { for _, src := range srcFA { for _, dst := range dstFA { + if src == dst && (len(srcFA) > 1 || len(dstFA) > 1) { + // Globs do not make self edges. + continue + } + + // If either has a double glob at the end we only select leafs, those without children. + if srcKP.Path[len(srcKP.Path)-1].ScalarString() == "**" || dstKP.Path[len(dstKP.Path)-1].ScalarString() == "**" { + if src.Map().IsContainer() || dst.Map().IsContainer() { + continue + } + } + eid2 := eid.Copy() eid2.SrcPath = RelIDA(m, src) eid2.DstPath = RelIDA(m, dst) diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index fdcd53af9..2d701a568 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -126,7 +126,7 @@ a*n*t*.constant.t*ink*r*t*inke*: globbed`) animal an* -> an*`) assert.Success(t, err) - assertQuery(t, m, 2, 4, nil, "") + assertQuery(t, m, 2, 2, nil, "") assertQuery(t, m, 0, 0, nil, "(animate -> animal)[0]") assertQuery(t, m, 0, 0, nil, "(animal -> animal)[0]") }, @@ -138,10 +138,10 @@ an* -> an*`) shared.animal sh*.(an* -> an*)`) assert.Success(t, err) - assertQuery(t, m, 3, 4, nil, "") - assertQuery(t, m, 2, 4, nil, "shared") + assertQuery(t, m, 3, 2, nil, "") + assertQuery(t, m, 2, 2, nil, "shared") assertQuery(t, m, 0, 0, nil, "shared.(animate -> animal)[0]") - assertQuery(t, m, 0, 0, nil, "shared.(animal -> animal)[0]") + assertQuery(t, m, 0, 0, nil, "shared.(animal -> animate)[0]") }, }, { @@ -151,8 +151,8 @@ sh*.(an* -> an*)`) shared.animal sh*.an* -> sh*.an*`) assert.Success(t, err) - assertQuery(t, m, 3, 4, nil, "") - assertQuery(t, m, 2, 4, nil, "shared") + assertQuery(t, m, 3, 2, nil, "") + assertQuery(t, m, 2, 2, nil, "shared") assertQuery(t, m, 0, 0, nil, "shared.(animate -> animal)[0]") assertQuery(t, m, 0, 0, nil, "shared.(animal -> animal)[0]") }, @@ -189,6 +189,23 @@ c -> b assertQuery(t, m, 0, 0, "red", "(c -> b)[0].style.fill") }, }, + { + name: "edge-nexus", + run: func(t testing.TB) { + m, err := compile(t, `a +b +c +d +* -> nexus +`) + assert.Success(t, err) + assertQuery(t, m, 5, 4, nil, "") + assertQuery(t, m, 0, 0, nil, "(a -> nexus)[0]") + assertQuery(t, m, 0, 0, nil, "(b -> nexus)[0]") + assertQuery(t, m, 0, 0, nil, "(c -> nexus)[0]") + assertQuery(t, m, 0, 0, nil, "(d -> nexus)[0]") + }, + }, { name: "double-glob/1", run: func(t testing.TB) { @@ -205,6 +222,22 @@ shared.animal assertQuery(t, m, 1, 0, nil, "shared.animal.style") }, }, + { + name: "double-glob/edge-no-container", + run: func(t testing.TB) { + m, err := compile(t, `zone A: { + machine A + machine B: { + submachine A + submachine B + } +} +zone A.** -> load balancer +`) + assert.Success(t, err) + assertQuery(t, m, 6, 3, nil, "") + }, + }, { name: "reserved", run: func(t testing.TB) { @@ -220,7 +253,7 @@ Spiderman 3 * -> *: arrow`) assert.Success(t, err) - assertQuery(t, m, 6, 9, nil, "") + assertQuery(t, m, 6, 6, nil, "") assertQuery(t, m, 0, 0, "arrow", "(* -> *)[*]") }, }, diff --git a/testdata/d2ir/TestCompile/patterns/double-glob/edge-no-container.exp.json b/testdata/d2ir/TestCompile/patterns/double-glob/edge-no-container.exp.json new file mode 100644 index 000000000..9e115779c --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/double-glob/edge-no-container.exp.json @@ -0,0 +1,1161 @@ +{ + "fields": [ + { + "name": "zone A", + "composite": { + "fields": [ + { + "name": "machine A", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "value": [ + { + "string": "machine A", + "raw_string": "machine A" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "value": [ + { + "string": "machine A", + "raw_string": "machine A" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "value": [ + { + "string": "machine A", + "raw_string": "machine A" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "machine B", + "composite": { + "fields": [ + { + "name": "submachine A", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "value": [ + { + "string": "submachine A", + "raw_string": "submachine A" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "value": [ + { + "string": "submachine A", + "raw_string": "submachine A" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "value": [ + { + "string": "submachine A", + "raw_string": "submachine A" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "submachine B", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "value": [ + { + "string": "submachine B", + "raw_string": "submachine B" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "value": [ + { + "string": "submachine B", + "raw_string": "submachine B" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "value": [ + { + "string": "submachine B", + "raw_string": "submachine B" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-2:10:31", + "value": [ + { + "string": "machine B", + "raw_string": "machine B" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-2:10:31", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-2:10:31", + "value": [ + { + "string": "machine B", + "raw_string": "machine B" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-5:2:67", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-2:10:31", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-2:10:31", + "value": [ + { + "string": "machine B", + "raw_string": "machine B" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:12:33-5:2:67", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "value": [ + { + "string": "submachine A", + "raw_string": "submachine A" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "value": [ + { + "string": "submachine B", + "raw_string": "submachine B" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,0:0:0-0:6:6", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,0:0:0-0:6:6", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,0:0:0-6:1:69", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,0:0:0-0:6:6", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,0:8:8-6:1:69", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,1:1:11-1:10:20", + "value": [ + { + "string": "machine A", + "raw_string": "machine A" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-5:2:67", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-2:10:31", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:1:22-2:10:31", + "value": [ + { + "string": "machine B", + "raw_string": "machine B" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,2:12:33-5:2:67", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,3:2:37-3:14:49", + "value": [ + { + "string": "submachine A", + "raw_string": "submachine A" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,4:2:52-4:14:64", + "value": [ + { + "string": "submachine B", + "raw_string": "submachine B" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "load balancer", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "zone A", + "machine A" + ], + "src_arrow": false, + "dst_path": [ + "load balancer" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "zone A", + "machine B", + "submachine A" + ], + "src_arrow": false, + "dst_path": [ + "load balancer" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "zone A", + "machine B", + "submachine B" + ], + "src_arrow": false, + "dst_path": [ + "load balancer" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:26:96", + "src": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:9:79", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:0:70-7:6:76", + "value": [ + { + "string": "zone A", + "raw_string": "zone A" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:7:77-7:9:79", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge-no-container.d2,7:13:83-7:26:96", + "value": [ + { + "string": "load balancer", + "raw_string": "load balancer" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] +} diff --git a/testdata/d2ir/TestCompile/patterns/edge-nexus.exp.json b/testdata/d2ir/TestCompile/patterns/edge-nexus.exp.json new file mode 100644 index 000000000..ee685d494 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/edge-nexus.exp.json @@ -0,0 +1,779 @@ +{ + "fields": [ + { + "name": "a", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1", + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "b", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3", + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,1:0:2-1:1:3", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "c", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5", + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,2:0:4-2:1:5", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "d", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7", + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,3:0:6-3:1:7", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "nexus", + "references": [ + { + "string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "edges": [ + { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "nexus" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "edges": [ + { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "b" + ], + "src_arrow": false, + "dst_path": [ + "nexus" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "edges": [ + { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "c" + ], + "src_arrow": false, + "dst_path": [ + "nexus" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "edges": [ + { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "d" + ], + "src_arrow": false, + "dst_path": [ + "nexus" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "edges": [ + { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:10:18", + "src": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:0:8-4:1:9", + "value": [ + { + "string": "*", + "raw_string": "*" + } + ], + "pattern": [ + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/edge-nexus.d2,4:5:13-4:10:18", + "value": [ + { + "string": "nexus", + "raw_string": "nexus" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] +} diff --git a/testdata/d2ir/TestCompile/patterns/edge/1.exp.json b/testdata/d2ir/TestCompile/patterns/edge/1.exp.json index 6e38e272d..087072d2d 100644 --- a/testdata/d2ir/TestCompile/patterns/edge/1.exp.json +++ b/testdata/d2ir/TestCompile/patterns/edge/1.exp.json @@ -114,123 +114,6 @@ } ], "edges": [ - { - "edge_id": { - "src_path": [ - "animate" - ], - "src_arrow": false, - "dst_path": [ - "animate" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", - "src": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", - "edges": [ - { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", - "src": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - } - ] - }, { "edge_id": { "src_path": [ @@ -464,123 +347,6 @@ } } ] - }, - { - "edge_id": { - "src_path": [ - "animal" - ], - "src_arrow": false, - "dst_path": [ - "animal" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", - "src": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", - "edges": [ - { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:10:25", - "src": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:0:15-2:3:18", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/1.d2,2:7:22-2:10:25", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - } - ] } ] } diff --git a/testdata/d2ir/TestCompile/patterns/edge/2.exp.json b/testdata/d2ir/TestCompile/patterns/edge/2.exp.json index 95a956c07..016f524db 100644 --- a/testdata/d2ir/TestCompile/patterns/edge/2.exp.json +++ b/testdata/d2ir/TestCompile/patterns/edge/2.exp.json @@ -162,143 +162,6 @@ } ], "edges": [ - { - "edge_id": { - "src_path": [ - "animate" - ], - "src_arrow": false, - "dst_path": [ - "animate" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", - "src": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45", - "key": { - "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - } - ] - }, - "edges": [ - { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", - "src": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - } - ] - }, { "edge_id": { "src_path": [ @@ -572,143 +435,6 @@ } } ] - }, - { - "edge_id": { - "src_path": [ - "animal" - ], - "src_arrow": false, - "dst_path": [ - "animal" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", - "src": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:16:45", - "key": { - "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:0:29-2:3:32", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - } - ] - }, - "edges": [ - { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:15:44", - "src": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:5:34-2:8:37", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/2.d2,2:12:41-2:15:44", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - } - ] } ] }, diff --git a/testdata/d2ir/TestCompile/patterns/edge/3.exp.json b/testdata/d2ir/TestCompile/patterns/edge/3.exp.json index 3316812a8..a6a0200bc 100644 --- a/testdata/d2ir/TestCompile/patterns/edge/3.exp.json +++ b/testdata/d2ir/TestCompile/patterns/edge/3.exp.json @@ -162,183 +162,6 @@ } ], "edges": [ - { - "edge_id": { - "src_path": [ - "animate" - ], - "src_arrow": false, - "dst_path": [ - "animate" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", - "src": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", - "edges": [ - { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", - "src": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - } - ] - }, { "edge_id": { "src_path": [ @@ -692,183 +515,6 @@ } } ] - }, - { - "edge_id": { - "src_path": [ - "animal" - ], - "src_arrow": false, - "dst_path": [ - "animal" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", - "src": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", - "edges": [ - { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:18:47", - "src": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:7:36", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:0:29-2:3:32", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:4:33-2:7:36", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:18:47", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:11:40-2:14:43", - "value": [ - { - "string": "sh*", - "raw_string": "sh*" - } - ], - "pattern": [ - "sh", - "*" - ] - } - }, - { - "unquoted_string": { - "range": "TestCompile/patterns/edge/3.d2,2:15:44-2:18:47", - "value": [ - { - "string": "an*", - "raw_string": "an*" - } - ], - "pattern": [ - "an", - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": {} - } - } - } - ] } ] }, diff --git a/testdata/d2ir/TestCompile/patterns/reserved.exp.json b/testdata/d2ir/TestCompile/patterns/reserved.exp.json index 091efd0df..01fb1938f 100644 --- a/testdata/d2ir/TestCompile/patterns/reserved.exp.json +++ b/testdata/d2ir/TestCompile/patterns/reserved.exp.json @@ -476,140 +476,6 @@ } ], "edges": [ - { - "edge_id": { - "src_path": [ - "Spiderman 1" - ], - "src_arrow": false, - "dst_path": [ - "Spiderman 1" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "primary": { - "value": { - "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", - "value": [ - { - "string": "arrow", - "raw_string": "arrow" - } - ] - } - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", - "src": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", - "edges": [ - { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", - "src": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", - "value": [ - { - "string": "arrow", - "raw_string": "arrow" - } - ] - } - } - } - } - } - ] - }, { "edge_id": { "src_path": [ @@ -1012,140 +878,6 @@ } ] }, - { - "edge_id": { - "src_path": [ - "Spiderman 2" - ], - "src_arrow": false, - "dst_path": [ - "Spiderman 2" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "primary": { - "value": { - "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", - "value": [ - { - "string": "arrow", - "raw_string": "arrow" - } - ] - } - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", - "src": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", - "edges": [ - { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", - "src": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", - "value": [ - { - "string": "arrow", - "raw_string": "arrow" - } - ] - } - } - } - } - } - ] - }, { "edge_id": { "src_path": [ @@ -1547,140 +1279,6 @@ } } ] - }, - { - "edge_id": { - "src_path": [ - "Spiderman 3" - ], - "src_arrow": false, - "dst_path": [ - "Spiderman 3" - ], - "dst_arrow": true, - "index": 0, - "glob": false - }, - "primary": { - "value": { - "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", - "value": [ - { - "string": "arrow", - "raw_string": "arrow" - } - ] - } - }, - "references": [ - { - "context": { - "edge": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", - "src": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - }, - "key": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:13:103", - "edges": [ - { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:6:96", - "src": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:0:90-10:1:91", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "src_arrow": "", - "dst": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:5:95-10:6:96", - "value": [ - { - "string": "*", - "raw_string": "*" - } - ], - "pattern": [ - "*" - ] - } - } - ] - }, - "dst_arrow": ">" - } - ], - "primary": {}, - "value": { - "unquoted_string": { - "range": "TestCompile/patterns/reserved.d2,10:8:98-10:13:103", - "value": [ - { - "string": "arrow", - "raw_string": "arrow" - } - ] - } - } - } - } - } - ] } ] } From 6fdf4b07a5b217a3aabcc7c90b350c6020f8298a Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sun, 30 Jul 2023 03:15:33 -0700 Subject: [PATCH 14/15] d2ir: Make double globs work sanely across boards See test. --- d2ast/d2ast.go | 9 + d2ir/d2ir.go | 8 +- d2ir/pattern.go | 4 +- d2ir/pattern_test.go | 28 + .../layers/errs/3/bad_edge.exp.json | 1375 ++++++ .../TestCompile/patterns/scenarios.exp.json | 3863 +++++++++++++++++ 6 files changed, 5284 insertions(+), 3 deletions(-) create mode 100644 testdata/d2ir/TestCompile/layers/errs/3/bad_edge.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/scenarios.exp.json diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index 83ee1b54b..79c256b2c 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -747,6 +747,15 @@ func (kp *KeyPath) Copy() *KeyPath { return &kp2 } +func (kp *KeyPath) HasDoubleGlob() bool { + for _, el := range kp.Path { + if el.ScalarString() == "**" { + return true + } + } + return false +} + type Edge struct { Range Range `json:"range"` diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index 531eaea56..e542394fd 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -1084,11 +1084,15 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { continue } - // If either has a double glob at the end we only select leafs, those without children. - if srcKP.Path[len(srcKP.Path)-1].ScalarString() == "**" || dstKP.Path[len(dstKP.Path)-1].ScalarString() == "**" { + if srcKP.HasDoubleGlob() || dstKP.HasDoubleGlob() { + // If either has a double glob we only select leafs, those without children. if src.Map().IsContainer() || dst.Map().IsContainer() { continue } + // If either has a double glob we ignore connections across boards + if ParentBoard(src) != ParentBoard(dst) { + continue + } } eid2 := eid.Copy() diff --git a/d2ir/pattern.go b/d2ir/pattern.go index 067f629e0..9409e0363 100644 --- a/d2ir/pattern.go +++ b/d2ir/pattern.go @@ -18,7 +18,9 @@ func (m *Map) doubleGlob(pattern []string) ([]*Field, bool) { func (m *Map) _doubleGlob(fa *[]*Field) { for _, f := range m.Fields { if _, ok := d2graph.ReservedKeywords[f.Name]; ok { - continue + if _, ok := d2graph.BoardKeywords[f.Name]; !ok { + continue + } } *fa = append(*fa, f) if f.Map() != nil { diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index 2d701a568..b291e2c43 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -257,6 +257,34 @@ Spiderman 3 assertQuery(t, m, 0, 0, "arrow", "(* -> *)[*]") }, }, + { + name: "scenarios", + run: func(t testing.TB) { + m, err := compile(t, ` + +scenarios: { + meow: { + e + f + g + h + } +} + +a +b +c +d + +**: something +** -> ** +`) + assert.Success(t, err) + assertQuery(t, m, 10, 24, nil, "") + assertQuery(t, m, 0, 0, "something", "**") + assertQuery(t, m, 0, 0, nil, "(* -> *)[*]") + }, + }, } runa(t, tca) diff --git a/testdata/d2ir/TestCompile/layers/errs/3/bad_edge.exp.json b/testdata/d2ir/TestCompile/layers/errs/3/bad_edge.exp.json new file mode 100644 index 000000000..5cd2e210c --- /dev/null +++ b/testdata/d2ir/TestCompile/layers/errs/3/bad_edge.exp.json @@ -0,0 +1,1375 @@ +{ + "fields": [ + { + "name": "layers", + "composite": { + "fields": [ + { + "name": "x", + "composite": { + "fields": [ + { + "name": "y", + "references": [ + { + "string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "edges": [ + { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "edges": [ + { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "edges": [ + { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "steps", + "composite": { + "fields": [ + { + "name": "z", + "composite": { + "fields": [ + { + "name": "p", + "references": [ + { + "string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "edges": [ + { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "edges": [ + { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + }, + "key_path": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "edges": [ + { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:23:23", + "src": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:10:10", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:0:0-0:6:6", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:7:7-0:8:8", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:9:9-0:10:10", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:23:23", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:14:14-0:19:19", + "value": [ + { + "string": "steps", + "raw_string": "steps" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:20:20-0:21:21", + "value": [ + { + "string": "z", + "raw_string": "z" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/layers/errs/3/bad_edge.d2,0:22:22-0:23:23", + "value": [ + { + "string": "p", + "raw_string": "p" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null +} diff --git a/testdata/d2ir/TestCompile/patterns/scenarios.exp.json b/testdata/d2ir/TestCompile/patterns/scenarios.exp.json new file mode 100644 index 000000000..4fdd38d3b --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/scenarios.exp.json @@ -0,0 +1,3863 @@ +{ + "fields": [ + { + "name": "scenarios", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "composite": { + "fields": [ + { + "name": "meow", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "composite": { + "fields": [ + { + "name": "e", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "value": [ + { + "string": "e", + "raw_string": "e" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "value": [ + { + "string": "e", + "raw_string": "e" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "key": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "value": [ + { + "string": "e", + "raw_string": "e" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "f", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "value": [ + { + "string": "f", + "raw_string": "f" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "value": [ + { + "string": "f", + "raw_string": "f" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "key": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "value": [ + { + "string": "f", + "raw_string": "f" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "g", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "value": [ + { + "string": "g", + "raw_string": "g" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "value": [ + { + "string": "g", + "raw_string": "g" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "key": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "value": [ + { + "string": "g", + "raw_string": "g" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "h", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "value": [ + { + "string": "h", + "raw_string": "h" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "value": [ + { + "string": "h", + "raw_string": "h" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "key": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "value": [ + { + "string": "h", + "raw_string": "h" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-3:6:21", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-3:6:21", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-3:6:21", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-8:3:40", + "key": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-3:6:21", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-3:6:21", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/scenarios.d2,3:8:23-8:3:40", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "key": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "value": [ + { + "string": "e", + "raw_string": "e" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "key": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "value": [ + { + "string": "f", + "raw_string": "f" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "key": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "value": [ + { + "string": "g", + "raw_string": "g" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "key": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "value": [ + { + "string": "h", + "raw_string": "h" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,2:0:2-2:9:11", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,2:0:2-2:9:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,2:0:2-2:9:11", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,2:0:2-9:1:42", + "key": { + "range": "TestCompile/patterns/scenarios.d2,2:0:2-2:9:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,2:0:2-2:9:11", + "value": [ + { + "string": "scenarios", + "raw_string": "scenarios" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/scenarios.d2,2:11:13-9:1:42", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-8:3:40", + "key": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-3:6:21", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,3:2:17-3:6:21", + "value": [ + { + "string": "meow", + "raw_string": "meow" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/scenarios.d2,3:8:23-8:3:40", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "key": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,4:1:26-4:2:27", + "value": [ + { + "string": "e", + "raw_string": "e" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "key": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,5:1:29-5:2:30", + "value": [ + { + "string": "f", + "raw_string": "f" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "key": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,6:1:32-6:2:33", + "value": [ + { + "string": "g", + "raw_string": "g" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "key": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,7:1:35-7:2:36", + "value": [ + { + "string": "h", + "raw_string": "h" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + } + } + } + } + } + ] + }, + { + "name": "a", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,11:0:44-11:1:45", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,11:0:44-11:1:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,11:0:44-11:1:45", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,11:0:44-11:1:45", + "key": { + "range": "TestCompile/patterns/scenarios.d2,11:0:44-11:1:45", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,11:0:44-11:1:45", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "b", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,12:0:46-12:1:47", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,12:0:46-12:1:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,12:0:46-12:1:47", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,12:0:46-12:1:47", + "key": { + "range": "TestCompile/patterns/scenarios.d2,12:0:46-12:1:47", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,12:0:46-12:1:47", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "c", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,13:0:48-13:1:49", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,13:0:48-13:1:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,13:0:48-13:1:49", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,13:0:48-13:1:49", + "key": { + "range": "TestCompile/patterns/scenarios.d2,13:0:48-13:1:49", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,13:0:48-13:1:49", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "d", + "primary": { + "value": { + "range": "TestCompile/patterns/scenarios.d2,16:4:57-16:13:66", + "value": [ + { + "string": "something", + "raw_string": "something" + } + ] + } + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/scenarios.d2,14:0:50-14:1:51", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/scenarios.d2,14:0:50-14:1:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,14:0:50-14:1:51", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/scenarios.d2,14:0:50-14:1:51", + "key": { + "range": "TestCompile/patterns/scenarios.d2,14:0:50-14:1:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,14:0:50-14:1:51", + "value": [ + { + "string": "d", + "raw_string": "d" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "e" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "f" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "e" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "g" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "e" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "h" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "f" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "e" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "f" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "g" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "f" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "h" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "g" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "e" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "g" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "f" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "g" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "h" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "h" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "e" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "h" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "f" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "scenarios", + "meow", + "h" + ], + "src_arrow": false, + "dst_path": [ + "scenarios", + "meow", + "g" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "c" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "a" + ], + "src_arrow": false, + "dst_path": [ + "d" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "b" + ], + "src_arrow": false, + "dst_path": [ + "a" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "b" + ], + "src_arrow": false, + "dst_path": [ + "c" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "b" + ], + "src_arrow": false, + "dst_path": [ + "d" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "c" + ], + "src_arrow": false, + "dst_path": [ + "a" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "c" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "c" + ], + "src_arrow": false, + "dst_path": [ + "d" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "d" + ], + "src_arrow": false, + "dst_path": [ + "a" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "d" + ], + "src_arrow": false, + "dst_path": [ + "b" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "edge_id": { + "src_path": [ + "d" + ], + "src_arrow": false, + "dst_path": [ + "c" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "edges": [ + { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:8:75", + "src": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:0:67-17:2:69", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/scenarios.d2,17:6:73-17:8:75", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] +} From 6ca36e6b0c0ede659bd80306830e3ce8574a63b2 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sun, 30 Jul 2023 12:41:15 -0700 Subject: [PATCH 15/15] d2ir: Glob review fixes --- d2ast/d2ast.go | 11 +- d2ir/compile.go | 12 +- d2ir/d2ir.go | 76 +- d2ir/pattern_test.go | 29 + .../patterns/double-glob/edge/1.exp.json | 811 ++++++++++++++++++ .../patterns/double-glob/edge/2.exp.json | 511 +++++++++++ 6 files changed, 1381 insertions(+), 69 deletions(-) create mode 100644 testdata/d2ir/TestCompile/patterns/double-glob/edge/1.exp.json create mode 100644 testdata/d2ir/TestCompile/patterns/double-glob/edge/2.exp.json diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index 79c256b2c..6b6f47389 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -749,7 +749,16 @@ func (kp *KeyPath) Copy() *KeyPath { func (kp *KeyPath) HasDoubleGlob() bool { for _, el := range kp.Path { - if el.ScalarString() == "**" { + if el.UnquotedString != nil && el.ScalarString() == "**" { + return true + } + } + return false +} + +func (kp *KeyPath) HasGlob() bool { + for _, el := range kp.Path { + if el.UnquotedString != nil && len(el.UnquotedString.Pattern) > 0 { return true } } diff --git a/d2ir/compile.go b/d2ir/compile.go index c2bff5f55..43763139d 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -661,17 +661,7 @@ func (c *compiler) _compileEdges(refctx *RefContext) { refctx.ScopeMap.appendFieldReferences(0, refctx.Edge.Dst, refctx) } } else { - _, err := refctx.ScopeMap.EnsureField(refctx.Edge.Src, refctx, true) - if err != nil { - c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) - continue - } - _, err = refctx.ScopeMap.EnsureField(refctx.Edge.Dst, refctx, true) - if err != nil { - c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) - continue - } - + var err error ea, err = refctx.ScopeMap.CreateEdge(eid, refctx) if err != nil { c.err.Errors = append(c.err.Errors, err.(d2ast.Error)) diff --git a/d2ir/d2ir.go b/d2ir/d2ir.go index e542394fd..4550a9857 100644 --- a/d2ir/d2ir.go +++ b/d2ir/d2ir.go @@ -935,34 +935,11 @@ func (m *Map) getEdges(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { return nil } - srcKP := d2ast.MakeKeyPath(eid.SrcPath) - lastMatch := 0 - for i, el := range srcKP.Path { - for j := lastMatch; j < len(refctx.Edge.Src.Path); j++ { - realEl := refctx.Edge.Src.Path[j] - if el.ScalarString() == realEl.ScalarString() { - srcKP.Path[i] = realEl - lastMatch += j + 1 - } - } - } - dstKP := d2ast.MakeKeyPath(eid.DstPath) - lastMatch = 0 - for i, el := range dstKP.Path { - for j := lastMatch; j < len(refctx.Edge.Dst.Path); j++ { - realEl := refctx.Edge.Dst.Path[j] - if el.ScalarString() == realEl.ScalarString() { - dstKP.Path[i] = realEl - lastMatch += j + 1 - } - } - } - - srcFA, err := m.EnsureField(srcKP, nil, false) + srcFA, err := refctx.ScopeMap.EnsureField(refctx.Edge.Src, nil, false) if err != nil { return err } - dstFA, err := m.EnsureField(dstKP, nil, false) + dstFA, err := refctx.ScopeMap.EnsureField(refctx.Edge.Dst, nil, false) if err != nil { return err } @@ -1045,51 +1022,36 @@ func (m *Map) createEdge(eid *EdgeID, refctx *RefContext, ea *[]*Edge) error { return d2parser.Errorf(refctx.Edge.Dst.Path[ij].Unbox(), "edge with board keyword alone doesn't make sense") } - srcKP := d2ast.MakeKeyPath(eid.SrcPath) - lastMatch := 0 - for i, el := range srcKP.Path { - for j := lastMatch; j < len(refctx.Edge.Src.Path); j++ { - realEl := refctx.Edge.Src.Path[j] - if el.ScalarString() == realEl.ScalarString() { - srcKP.Path[i] = realEl - lastMatch += j + 1 - } - } - } - dstKP := d2ast.MakeKeyPath(eid.DstPath) - lastMatch = 0 - for i, el := range dstKP.Path { - for j := lastMatch; j < len(refctx.Edge.Dst.Path); j++ { - realEl := refctx.Edge.Dst.Path[j] - if el.ScalarString() == realEl.ScalarString() { - dstKP.Path[i] = realEl - lastMatch += j + 1 - } - } - } - - srcFA, err := m.EnsureField(srcKP, nil, true) + srcFA, err := refctx.ScopeMap.EnsureField(refctx.Edge.Src, refctx, true) if err != nil { return err } - dstFA, err := m.EnsureField(dstKP, nil, true) + dstFA, err := refctx.ScopeMap.EnsureField(refctx.Edge.Dst, refctx, true) if err != nil { return err } for _, src := range srcFA { for _, dst := range dstFA { - if src == dst && (len(srcFA) > 1 || len(dstFA) > 1) { + if src == dst && (refctx.Edge.Src.HasGlob() || refctx.Edge.Dst.HasGlob()) { // Globs do not make self edges. continue } - if srcKP.HasDoubleGlob() || dstKP.HasDoubleGlob() { - // If either has a double glob we only select leafs, those without children. - if src.Map().IsContainer() || dst.Map().IsContainer() { + if refctx.Edge.Src.HasDoubleGlob() { + // If src has a double glob we only select leafs, those without children. + if src.Map().IsContainer() { + continue + } + if ParentBoard(src) != ParentBoard(dst) { + continue + } + } + if refctx.Edge.Dst.HasDoubleGlob() { + // If dst has a double glob we only select leafs, those without children. + if dst.Map().IsContainer() { continue } - // If either has a double glob we ignore connections across boards if ParentBoard(src) != ParentBoard(dst) { continue } @@ -1121,7 +1083,7 @@ func (m *Map) createEdge2(eid *EdgeID, refctx *RefContext, src, dst *Field) (*Ed eid.Index = nil eid.Glob = true - ea := m.GetEdges(eid, refctx) + ea := m.GetEdges(eid, nil) index := len(ea) eid.Index = &index eid.Glob = false @@ -1400,7 +1362,7 @@ func IDA(n Node) (ida []string) { } } -// RelIDA returns the absolute path to n relative to p. +// RelIDA returns the path to n relative to p. func RelIDA(p, n Node) (ida []string) { for { f, ok := n.(*Field) diff --git a/d2ir/pattern_test.go b/d2ir/pattern_test.go index b291e2c43..aabd8be58 100644 --- a/d2ir/pattern_test.go +++ b/d2ir/pattern_test.go @@ -285,6 +285,35 @@ d assertQuery(t, m, 0, 0, nil, "(* -> *)[*]") }, }, + { + name: "double-glob/edge/1", + run: func(t testing.TB) { + m, err := compile(t, `fast: { + a + far +} + +task: { + a +} + +task.** -> fast +`) + assert.Success(t, err) + assertQuery(t, m, 5, 1, nil, "") + }, + }, + { + name: "double-glob/edge/2", + run: func(t testing.TB) { + m, err := compile(t, `a + +**.b -> c +`) + assert.Success(t, err) + assertQuery(t, m, 3, 1, nil, "") + }, + }, } runa(t, tca) diff --git a/testdata/d2ir/TestCompile/patterns/double-glob/edge/1.exp.json b/testdata/d2ir/TestCompile/patterns/double-glob/edge/1.exp.json new file mode 100644 index 000000000..209501268 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/double-glob/edge/1.exp.json @@ -0,0 +1,811 @@ +{ + "fields": [ + { + "name": "fast", + "composite": { + "fields": [ + { + "name": "a", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "far", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "value": [ + { + "string": "far", + "raw_string": "far" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "value": [ + { + "string": "far", + "raw_string": "far" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "value": [ + { + "string": "far", + "raw_string": "far" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,0:0:0-0:4:4", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,0:0:0-0:4:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,0:0:0-0:4:4", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,0:0:0-3:1:19", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,0:0:0-0:4:4", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,0:0:0-0:4:4", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,0:6:6-3:1:19", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,1:2:10-1:3:11", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,2:2:14-2:5:17", + "value": [ + { + "string": "far", + "raw_string": "far" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "src": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:7:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:5:41-9:7:43", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "src": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:7:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:5:41-9:7:43", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "task", + "composite": { + "fields": [ + { + "name": "a", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,5:0:21-5:4:25", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,5:0:21-5:4:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,5:0:21-5:4:25", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,5:0:21-7:1:34", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,5:0:21-5:4:25", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,5:0:21-5:4:25", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,5:6:27-7:1:34", + "nodes": [ + { + "map_key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,6:2:31-6:3:32", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + }, + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:7:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:5:41-9:7:43", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "src": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:7:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:5:41-9:7:43", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "src": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:7:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:5:41-9:7:43", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "task", + "a" + ], + "src_arrow": false, + "dst_path": [ + "fast" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "src": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:7:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:5:41-9:7:43", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:15:51", + "src": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:7:43", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:0:36-9:4:40", + "value": [ + { + "string": "task", + "raw_string": "task" + } + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:5:41-9:7:43", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/1.d2,9:11:47-9:15:51", + "value": [ + { + "string": "fast", + "raw_string": "fast" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] +} diff --git a/testdata/d2ir/TestCompile/patterns/double-glob/edge/2.exp.json b/testdata/d2ir/TestCompile/patterns/double-glob/edge/2.exp.json new file mode 100644 index 000000000..ec8c116c4 --- /dev/null +++ b/testdata/d2ir/TestCompile/patterns/double-glob/edge/2.exp.json @@ -0,0 +1,511 @@ +{ + "fields": [ + { + "name": "a", + "composite": { + "fields": [ + { + "name": "b", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:4:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:2:5", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "src": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:4:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:2:5", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "src": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:4:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:2:5", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": null + }, + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "context": { + "edge": null, + "key": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,0:0:0-0:1:1", + "key": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,0:0:0-0:1:1", + "value": [ + { + "string": "a", + "raw_string": "a" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + } + ] + }, + { + "name": "c", + "references": [ + { + "string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + }, + "key_path": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "src": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:4:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:2:5", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "src": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:4:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:2:5", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ], + "edges": [ + { + "edge_id": { + "src_path": [ + "a", + "b" + ], + "src_arrow": false, + "dst_path": [ + "c" + ], + "dst_arrow": true, + "index": 0, + "glob": false + }, + "references": [ + { + "context": { + "edge": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "src": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:4:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:2:5", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + }, + "key": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "edges": [ + { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:9:12", + "src": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:4:7", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:0:3-2:2:5", + "value": [ + { + "string": "**", + "raw_string": "**" + } + ], + "pattern": [ + "*", + "", + "*" + ] + } + }, + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:3:6-2:4:7", + "value": [ + { + "string": "b", + "raw_string": "b" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "path": [ + { + "unquoted_string": { + "range": "TestCompile/patterns/double-glob/edge/2.d2,2:8:11-2:9:12", + "value": [ + { + "string": "c", + "raw_string": "c" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + } + ] + } + ] +}