d2ir: IR Root wip
This commit is contained in:
parent
5741e0a4f9
commit
33ae53dc75
10 changed files with 1657 additions and 8 deletions
10
d2ir/d2ir.go
10
d2ir/d2ir.go
|
|
@ -321,7 +321,7 @@ type FieldReference struct {
|
|||
String *d2ast.StringBox `json:"string"`
|
||||
KeyPath *d2ast.KeyPath `json:"key_path"`
|
||||
|
||||
Context *RefContext `json:"-"`
|
||||
Context *RefContext `json:"context"`
|
||||
}
|
||||
|
||||
func (kr FieldReference) KeyPathIndex() int {
|
||||
|
|
@ -342,13 +342,13 @@ func (kr FieldReference) InEdge() bool {
|
|||
}
|
||||
|
||||
type EdgeReference struct {
|
||||
Context *RefContext `json:"-"`
|
||||
Context *RefContext `json:"context"`
|
||||
}
|
||||
|
||||
type RefContext struct {
|
||||
Key *d2ast.Key
|
||||
Edge *d2ast.Edge
|
||||
Scope *d2ast.Map
|
||||
Key *d2ast.Key `json:"key"`
|
||||
Edge *d2ast.Edge `json:"edge"`
|
||||
Scope *d2ast.Map `json:"-"`
|
||||
}
|
||||
|
||||
func (rc *RefContext) Copy() *RefContext {
|
||||
|
|
|
|||
638
testdata/d2ir/TestCompile/edge/nested.exp.json
generated
vendored
638
testdata/d2ir/TestCompile/edge/nested.exp.json
generated
vendored
|
|
@ -119,6 +119,133 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -165,6 +292,133 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -214,6 +468,133 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -260,6 +641,133 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -281,7 +789,135 @@
|
|||
"index": 0
|
||||
},
|
||||
"references": [
|
||||
{}
|
||||
{
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:10:10",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:4:4",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/nested.d2,0:6:6-0:10:10",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/nested.d2,0:9:9-0:10:10",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
252
testdata/d2ir/TestCompile/edge/root.exp.json
generated
vendored
252
testdata/d2ir/TestCompile/edge/root.exp.json
generated
vendored
|
|
@ -82,6 +82,89 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:2:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/root.d2,0:4:4-0:6:6",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:2:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/root.d2,0:4:4-0:6:6",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -116,6 +199,89 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:2:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/root.d2,0:4:4-0:6:6",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:2:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/root.d2,0:4:4-0:6:6",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -135,7 +301,91 @@
|
|||
"index": 0
|
||||
},
|
||||
"references": [
|
||||
{}
|
||||
{
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:2:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/root.d2,0:4:4-0:6:6",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:6:6",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:2:2",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/root.d2,0:4:4-0:6:6",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/root.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
300
testdata/d2ir/TestCompile/edge/underscore.exp.json
generated
vendored
300
testdata/d2ir/TestCompile/edge/underscore.exp.json
generated
vendored
|
|
@ -126,6 +126,111 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:9:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "_",
|
||||
"raw_string": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:11:11-0:14:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:12:12-0:13:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:9:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "_",
|
||||
"raw_string": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:11:11-0:14:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:12:12-0:13:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -161,6 +266,93 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:0:0-0:15:15",
|
||||
"key": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "p",
|
||||
"raw_string": "p"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:3:3-0:14:14",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:9:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "_",
|
||||
"raw_string": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:11:11-0:14:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:12:12-0:13:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -184,7 +376,113 @@
|
|||
"index": 0
|
||||
},
|
||||
"references": [
|
||||
{}
|
||||
{
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"edges": [
|
||||
{
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:9:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "_",
|
||||
"raw_string": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:11:11-0:14:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:12:12-0:13:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
],
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:14:14",
|
||||
"src": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:9:9",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:5:5-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "_",
|
||||
"raw_string": "_"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:7:7-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"src_arrow": "",
|
||||
"dst": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:11:11-0:14:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/edge/underscore.d2,0:12:12-0:13:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "z",
|
||||
"raw_string": "z"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"dst_arrow": ">"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
58
testdata/d2ir/TestCompile/field/array.exp.json
generated
vendored
58
testdata/d2ir/TestCompile/field/array.exp.json
generated
vendored
|
|
@ -125,6 +125,64 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/array.d2,0:0:0-0:12:12",
|
||||
"key": {
|
||||
"range": "TestCompile/field/array.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/array.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"array": {
|
||||
"range": "TestCompile/field/array.d2,0:3:3-0:11:11",
|
||||
"nodes": [
|
||||
{
|
||||
"number": {
|
||||
"range": "TestCompile/field/array.d2,0:4:4-0:5:5",
|
||||
"raw": "1",
|
||||
"value": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"number": {
|
||||
"range": "TestCompile/field/array.d2,0:6:6-0:7:7",
|
||||
"raw": "2",
|
||||
"value": "2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"number": {
|
||||
"range": "TestCompile/field/array.d2,0:8:8-0:9:9",
|
||||
"raw": "3",
|
||||
"value": "3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"number": {
|
||||
"range": "TestCompile/field/array.d2,0:10:10-0:11:11",
|
||||
"raw": "4",
|
||||
"value": "4"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
34
testdata/d2ir/TestCompile/field/label.exp.json
generated
vendored
34
testdata/d2ir/TestCompile/field/label.exp.json
generated
vendored
|
|
@ -80,6 +80,40 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/label.d2,0:0:0-0:6:6",
|
||||
"key": {
|
||||
"range": "TestCompile/field/label.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/label.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/label.d2,0:3:3-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "yes",
|
||||
"raw_string": "yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
90
testdata/d2ir/TestCompile/field/nested.exp.json
generated
vendored
90
testdata/d2ir/TestCompile/field/nested.exp.json
generated
vendored
|
|
@ -106,6 +106,51 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/nested.d2,0:0:0-0:8:8",
|
||||
"key": {
|
||||
"range": "TestCompile/field/nested.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/nested.d2,0:5:5-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "yes",
|
||||
"raw_string": "yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -152,6 +197,51 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/nested.d2,0:0:0-0:8:8",
|
||||
"key": {
|
||||
"range": "TestCompile/field/nested.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/nested.d2,0:5:5-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "yes",
|
||||
"raw_string": "yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
172
testdata/d2ir/TestCompile/field/primary/nested.exp.json
generated
vendored
172
testdata/d2ir/TestCompile/field/primary/nested.exp.json
generated
vendored
|
|
@ -128,6 +128,30 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:16:16",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:16:16",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:15:15",
|
||||
"value": [
|
||||
{
|
||||
"string": "pqrs",
|
||||
"raw_string": "pqrs"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -174,6 +198,80 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:0:0-0:17:17",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:5:5-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "yes",
|
||||
"raw_string": "yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:9:9-0:16:16",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:16:16",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:16:16",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:15:15",
|
||||
"value": [
|
||||
{
|
||||
"string": "pqrs",
|
||||
"raw_string": "pqrs"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -220,6 +318,80 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:0:0-0:17:17",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "y",
|
||||
"raw_string": "y"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:5:5-0:8:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "yes",
|
||||
"raw_string": "yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:9:9-0:16:16",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:16:16",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:16:16",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/nested.d2,0:11:11-0:15:15",
|
||||
"value": [
|
||||
{
|
||||
"string": "pqrs",
|
||||
"raw_string": "pqrs"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
87
testdata/d2ir/TestCompile/field/primary/root.exp.json
generated
vendored
87
testdata/d2ir/TestCompile/field/primary/root.exp.json
generated
vendored
|
|
@ -113,6 +113,30 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:9:9-0:14:14",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:9:9-0:14:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:9:9-0:13:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "pqrs",
|
||||
"raw_string": "pqrs"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -148,6 +172,69 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:0:0-0:15:15",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:3:3-0:6:6",
|
||||
"value": [
|
||||
{
|
||||
"string": "yes",
|
||||
"raw_string": "yes"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:7:7-0:14:14",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:9:9-0:14:14",
|
||||
"key": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:9:9-0:14:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/primary/root.d2,0:9:9-0:13:13",
|
||||
"value": [
|
||||
{
|
||||
"string": "pqrs",
|
||||
"raw_string": "pqrs"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
24
testdata/d2ir/TestCompile/field/root.exp.json
generated
vendored
24
testdata/d2ir/TestCompile/field/root.exp.json
generated
vendored
|
|
@ -59,6 +59,30 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"context": {
|
||||
"key": {
|
||||
"range": "TestCompile/field/root.d2,0:0:0-0:1:1",
|
||||
"key": {
|
||||
"range": "TestCompile/field/root.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "TestCompile/field/root.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "x",
|
||||
"raw_string": "x"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
},
|
||||
"edge": null
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue