d2ir: Implement double globs
This commit is contained in:
parent
1217ff35a7
commit
d9b4b952ee
5 changed files with 1564 additions and 87 deletions
31
d2ir/d2ir.go
31
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 {
|
func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, fa *[]*Field) error {
|
||||||
us, ok := kp.Path[i].Unbox().(*d2ast.UnquotedString)
|
us, ok := kp.Path[i].Unbox().(*d2ast.UnquotedString)
|
||||||
if ok && us.Pattern != nil {
|
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 {
|
for _, f := range m.Fields {
|
||||||
if matchPattern(f.Name, us.Pattern) {
|
if matchPattern(f.Name, us.Pattern) {
|
||||||
if i == len(kp.Path)-1 {
|
if i == len(kp.Path)-1 {
|
||||||
*fa = append(*fa, f)
|
*fa = append(*fa, f)
|
||||||
} else if f.Map() != nil {
|
} else {
|
||||||
f.Map().ensureField(i+1, kp, refctx, fa)
|
if f.Map() == nil {
|
||||||
|
f.Composite = &Map{
|
||||||
|
parent: f,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err := f.Map().ensureField(i+1, kp, refctx, fa)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,31 @@ package d2ir
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"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 {
|
func matchPattern(s string, pattern []string) bool {
|
||||||
if len(pattern) == 0 {
|
if len(pattern) == 0 {
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ sh*.an* -> sh*.an*`)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "double-glob",
|
name: "double-glob/1",
|
||||||
run: func(t testing.TB) {
|
run: func(t testing.TB) {
|
||||||
m, err := compile(t, `shared.animate
|
m, err := compile(t, `shared.animate
|
||||||
shared.animal
|
shared.animal
|
||||||
|
|
@ -142,9 +142,11 @@ shared.animal
|
||||||
assert.Success(t, err)
|
assert.Success(t, err)
|
||||||
assertQuery(t, m, 9, 0, nil, "")
|
assertQuery(t, m, 9, 0, nil, "")
|
||||||
assertQuery(t, m, 8, 0, nil, "shared")
|
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, 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, 2, 0, nil, "shared.animal")
|
||||||
|
assertQuery(t, m, 1, 0, nil, "shared.animal.style")
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
496
testdata/d2ir/TestCompile/patterns/double-glob.exp.json
generated
vendored
496
testdata/d2ir/TestCompile/patterns/double-glob.exp.json
generated
vendored
|
|
@ -6,6 +6,203 @@
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"name": "animate",
|
"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": [
|
"references": [
|
||||||
{
|
{
|
||||||
"string": {
|
"string": {
|
||||||
|
|
@ -84,6 +281,203 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "animal",
|
"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": [
|
"references": [
|
||||||
{
|
{
|
||||||
"string": {
|
"string": {
|
||||||
|
|
@ -168,7 +562,7 @@
|
||||||
"name": "fill",
|
"name": "fill",
|
||||||
"primary": {
|
"primary": {
|
||||||
"value": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "red",
|
"string": "red",
|
||||||
|
|
@ -180,7 +574,7 @@
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "fill",
|
"string": "fill",
|
||||||
|
|
@ -189,27 +583,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"key_path": {
|
"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": [
|
"path": [
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"unquoted_string": {
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31",
|
"range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40",
|
||||||
"value": [
|
|
||||||
{
|
|
||||||
"string": "**",
|
|
||||||
"raw_string": "**"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"pattern": [
|
|
||||||
"*",
|
|
||||||
"",
|
|
||||||
"*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"unquoted_string": {
|
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37",
|
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "style",
|
"string": "style",
|
||||||
|
|
@ -220,7 +598,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "fill",
|
"string": "fill",
|
||||||
|
|
@ -234,29 +612,13 @@
|
||||||
"context": {
|
"context": {
|
||||||
"edge": null,
|
"edge": null,
|
||||||
"key": {
|
"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": {
|
"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": [
|
"path": [
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"unquoted_string": {
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31",
|
"range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40",
|
||||||
"value": [
|
|
||||||
{
|
|
||||||
"string": "**",
|
|
||||||
"raw_string": "**"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"pattern": [
|
|
||||||
"*",
|
|
||||||
"",
|
|
||||||
"*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"unquoted_string": {
|
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37",
|
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "style",
|
"string": "style",
|
||||||
|
|
@ -267,7 +629,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "fill",
|
"string": "fill",
|
||||||
|
|
@ -281,7 +643,7 @@
|
||||||
"primary": {},
|
"primary": {},
|
||||||
"value": {
|
"value": {
|
||||||
"unquoted_string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "red",
|
"string": "red",
|
||||||
|
|
@ -301,7 +663,7 @@
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "style",
|
"string": "style",
|
||||||
|
|
@ -310,27 +672,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"key_path": {
|
"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": [
|
"path": [
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"unquoted_string": {
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31",
|
"range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40",
|
||||||
"value": [
|
|
||||||
{
|
|
||||||
"string": "**",
|
|
||||||
"raw_string": "**"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"pattern": [
|
|
||||||
"*",
|
|
||||||
"",
|
|
||||||
"*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"unquoted_string": {
|
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37",
|
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "style",
|
"string": "style",
|
||||||
|
|
@ -341,7 +687,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "fill",
|
"string": "fill",
|
||||||
|
|
@ -355,29 +701,13 @@
|
||||||
"context": {
|
"context": {
|
||||||
"edge": null,
|
"edge": null,
|
||||||
"key": {
|
"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": {
|
"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": [
|
"path": [
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"unquoted_string": {
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:0:29-2:2:31",
|
"range": "TestCompile/patterns/double-glob.d2,2:6:35-2:11:40",
|
||||||
"value": [
|
|
||||||
{
|
|
||||||
"string": "**",
|
|
||||||
"raw_string": "**"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"pattern": [
|
|
||||||
"*",
|
|
||||||
"",
|
|
||||||
"*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"unquoted_string": {
|
|
||||||
"range": "TestCompile/patterns/double-glob.d2,2:3:32-2:8:37",
|
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "style",
|
"string": "style",
|
||||||
|
|
@ -388,7 +718,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unquoted_string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "fill",
|
"string": "fill",
|
||||||
|
|
@ -402,7 +732,7 @@
|
||||||
"primary": {},
|
"primary": {},
|
||||||
"value": {
|
"value": {
|
||||||
"unquoted_string": {
|
"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": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "red",
|
"string": "red",
|
||||||
|
|
|
||||||
1095
testdata/d2ir/TestCompile/patterns/double-glob/1.exp.json
generated
vendored
Normal file
1095
testdata/d2ir/TestCompile/patterns/double-glob/1.exp.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue