preserve attr
This commit is contained in:
parent
3bacc345e0
commit
c40fce1483
7 changed files with 1560 additions and 46 deletions
|
|
@ -1551,6 +1551,8 @@ func move(g *d2graph.Graph, key, newKey string, includeDescendants bool) (*d2gra
|
|||
if resolvedObj != obj {
|
||||
ida = resolvedIDA
|
||||
}
|
||||
// e.g. "a.b.shape: circle"
|
||||
_, endsWithReserved := d2graph.ReservedKeywords[ida[len(ida)-1]]
|
||||
ida = go2.Filter(ida, func(x string) bool {
|
||||
_, ok := d2graph.ReservedKeywords[x]
|
||||
return !ok
|
||||
|
|
@ -1603,7 +1605,7 @@ func move(g *d2graph.Graph, key, newKey string, includeDescendants bool) (*d2gra
|
|||
}
|
||||
|
||||
appendUniqueMapKey(toScope, detachedMK)
|
||||
} else if ((!includeDescendants && len(ida) > 1) || (includeDescendants && ref.KeyPathIndex > 0)) && (!isExplicit || go2.Contains(mostNestedRefs, ref)) {
|
||||
} else if ((!includeDescendants && len(ida) > 1) || (includeDescendants && ref.KeyPathIndex > 0)) && (endsWithReserved || !isExplicit || go2.Contains(mostNestedRefs, ref)) {
|
||||
// 2. Split
|
||||
detachedMK := &d2ast.Key{Key: cloneKey(ref.MapKey.Key)}
|
||||
if includeDescendants {
|
||||
|
|
@ -1611,10 +1613,13 @@ func move(g *d2graph.Graph, key, newKey string, includeDescendants bool) (*d2gra
|
|||
} else {
|
||||
detachedMK.Key.Path = []*d2ast.StringBox{ref.Key.Path[ref.KeyPathIndex]}
|
||||
}
|
||||
if ref.KeyPathIndex == len(ref.Key.Path)-1 {
|
||||
if includeDescendants || ref.KeyPathIndex == len(filterReservedPath(ref.Key.Path))-1 {
|
||||
withReserved, withoutReserved := filterReserved(ref.MapKey.Value)
|
||||
detachedMK.Value = withReserved
|
||||
ref.MapKey.Value = withoutReserved
|
||||
println("\033[1;31m--- DEBUG:", "=======================", "\033[m")
|
||||
detachedMK.Key.Path = append([]*d2ast.StringBox{}, ref.Key.Path[ref.KeyPathIndex:]...)
|
||||
ref.Key.Path = ref.Key.Path[:ref.KeyPathIndex+1]
|
||||
}
|
||||
if includeDescendants {
|
||||
ref.Key.Path = ref.Key.Path[:ref.KeyPathIndex]
|
||||
|
|
@ -2746,3 +2751,13 @@ func getMostNestedRefs(obj *d2graph.Object) []d2graph.Reference {
|
|||
|
||||
return out
|
||||
}
|
||||
|
||||
func filterReservedPath(path []*d2ast.StringBox) (filtered []*d2ast.StringBox) {
|
||||
for _, box := range path {
|
||||
if _, ok := d2graph.ReservedKeywords[strings.ToLower(box.Unbox().ScalarString())]; ok {
|
||||
return
|
||||
}
|
||||
filtered = append(filtered, box)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2582,8 +2582,9 @@ a.b.icon: https://icons.terrastruct.com/essentials/142-target.svg
|
|||
newKey: `b`,
|
||||
|
||||
exp: `a
|
||||
b.icon: https://icons.terrastruct.com/essentials/142-target.svg
|
||||
a
|
||||
b
|
||||
b.icon: https://icons.terrastruct.com/essentials/142-target.svg
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
|
@ -4226,6 +4227,61 @@ y
|
|||
x 2.y
|
||||
}
|
||||
y
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "nested_reserved_2",
|
||||
text: `A.B.C.shape: circle
|
||||
`,
|
||||
key: `A.B.C`,
|
||||
newKey: `C`,
|
||||
|
||||
exp: `A.B
|
||||
C.shape: circle
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "nested_reserved_3",
|
||||
text: `A.B.C.shape: circle
|
||||
A.B: {
|
||||
C
|
||||
D
|
||||
}
|
||||
`,
|
||||
key: `A.B.C`,
|
||||
newKey: `A.B.D.C`,
|
||||
|
||||
exp: `A.B
|
||||
A.B: {
|
||||
D: {
|
||||
C.shape: circle
|
||||
C
|
||||
}
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "include_descendants_nested_reserved_2",
|
||||
text: `A.B.C.shape: circle
|
||||
`,
|
||||
key: `A.B.C`,
|
||||
newKey: `C`,
|
||||
includeDescendants: true,
|
||||
|
||||
exp: `A.B
|
||||
C.shape: circle
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "include_descendants_nested_reserved_3",
|
||||
text: `A.B.C.shape: circle
|
||||
`,
|
||||
key: `A.B`,
|
||||
newKey: `C`,
|
||||
includeDescendants: true,
|
||||
|
||||
exp: `A
|
||||
C.C.shape: circle
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
292
testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.exp.json
generated
vendored
Normal file
292
testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
{
|
||||
"graph": {
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-2:0:20",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:0:4-1:15:19",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:0:4-1:7:11",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:0:4-1:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:2:6-1:7:11",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:9:13-1:15:19",
|
||||
"value": [
|
||||
{
|
||||
"string": "circle",
|
||||
"raw_string": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"id": "A",
|
||||
"id_val": "A",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "A"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"id_val": "B",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 1,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "B"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"id_val": "C",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:0:4-1:7:11",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:0:4-1:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_2.d2,1:2:6-1:7:11",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "C"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": "<nil>"
|
||||
}
|
||||
303
testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.exp.json
generated
vendored
Normal file
303
testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,303 @@
|
|||
{
|
||||
"graph": {
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,0:0:0-2:0:20",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:0:2-1:17:19",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:0:2-1:9:11",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:2:4-1:3:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:4:6-1:9:11",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:11:13-1:17:19",
|
||||
"value": [
|
||||
{
|
||||
"string": "circle",
|
||||
"raw_string": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"id": "A",
|
||||
"id_val": "A",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "A"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"id_val": "C",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:0:2-1:9:11",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:2:4-1:3:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:4:6-1:9:11",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "C"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"id_val": "C",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:0:2-1:9:11",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:2:4-1:3:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/include_descendants_nested_reserved_3.d2,1:4:6-1:9:11",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 1,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "C"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": "<nil>"
|
||||
}
|
||||
292
testdata/d2oracle/TestMove/nested_reserved_2.exp.json
generated
vendored
Normal file
292
testdata/d2oracle/TestMove/nested_reserved_2.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
{
|
||||
"graph": {
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-2:0:20",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:0:4-1:15:19",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:0:4-1:7:11",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:0:4-1:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:2:6-1:7:11",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:9:13-1:15:19",
|
||||
"value": [
|
||||
{
|
||||
"string": "circle",
|
||||
"raw_string": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"id": "A",
|
||||
"id_val": "A",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "A"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"id_val": "B",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 1,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "B"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"id_val": "C",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:0:4-1:7:11",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:0:4-1:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_2.d2,1:2:6-1:7:11",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "C"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": "<nil>"
|
||||
}
|
||||
513
testdata/d2oracle/TestMove/nested_reserved_3.exp.json
generated
vendored
Normal file
513
testdata/d2oracle/TestMove/nested_reserved_3.exp.json
generated
vendored
Normal file
|
|
@ -0,0 +1,513 @@
|
|||
{
|
||||
"graph": {
|
||||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-7:0:50",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-0:3:3",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:0:4-6:1:49",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:0:4-1:3:7",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:0:4-1:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:2:6-1:3:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:5:9-6:0:48",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,2:2:13-5:3:47",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,2:2:13-2:3:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,2:2:13-2:3:14",
|
||||
"value": [
|
||||
{
|
||||
"string": "D",
|
||||
"raw_string": "D"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"map": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,2:5:16-5:2:46",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:4:22-3:19:37",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:4:22-3:11:29",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:4:22-3:5:23",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:6:24-3:11:29",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:13:31-3:19:37",
|
||||
"value": [
|
||||
{
|
||||
"string": "circle",
|
||||
"raw_string": "circle"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,4:4:42-4:5:43",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,4:4:42-4:5:43",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,4:4:42-4:5:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"root": {
|
||||
"id": "",
|
||||
"id_val": "",
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": ""
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": ""
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
"edges": null,
|
||||
"objects": [
|
||||
{
|
||||
"id": "A",
|
||||
"id_val": "A",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:0:4-1:3:7",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:0:4-1:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:2:6-1:3:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "A"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "B",
|
||||
"id_val": "B",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-0:3:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:0:0-0:1:1",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,0:2:2-0:3:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 1,
|
||||
"map_key_edge_index": -1
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:0:4-1:3:7",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:0:4-1:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "A",
|
||||
"raw_string": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,1:2:6-1:3:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "B",
|
||||
"raw_string": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 1,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "B"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "D",
|
||||
"id_val": "D",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,2:2:13-2:3:14",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,2:2:13-2:3:14",
|
||||
"value": [
|
||||
{
|
||||
"string": "D",
|
||||
"raw_string": "D"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "D"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "rectangle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
},
|
||||
{
|
||||
"id": "C",
|
||||
"id_val": "C",
|
||||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:4:22-3:11:29",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:4:22-3:5:23",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,3:6:24-3:11:29",
|
||||
"value": [
|
||||
{
|
||||
"string": "shape",
|
||||
"raw_string": "shape"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,4:4:42-4:5:43",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/nested_reserved_3.d2,4:4:42-4:5:43",
|
||||
"value": [
|
||||
{
|
||||
"string": "C",
|
||||
"raw_string": "C"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
"label": {
|
||||
"value": "C"
|
||||
},
|
||||
"labelDimensions": {
|
||||
"width": 0,
|
||||
"height": 0
|
||||
},
|
||||
"style": {},
|
||||
"near_key": null,
|
||||
"shape": {
|
||||
"value": "circle"
|
||||
},
|
||||
"direction": {
|
||||
"value": ""
|
||||
},
|
||||
"constraint": {
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"zIndex": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"err": "<nil>"
|
||||
}
|
||||
129
testdata/d2oracle/TestMove/slice_style.exp.json
generated
vendored
129
testdata/d2oracle/TestMove/slice_style.exp.json
generated
vendored
|
|
@ -3,7 +3,7 @@
|
|||
"name": "",
|
||||
"isFolderOnly": false,
|
||||
"ast": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,0:0:0-3:0:68",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,0:0:0-4:0:70",
|
||||
"nodes": [
|
||||
{
|
||||
"map_key": {
|
||||
|
|
@ -30,13 +30,59 @@
|
|||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:63:65",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:1:3",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:6:8",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:1:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:4-2:1:5",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:4-2:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:4-2:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:0:6-3:63:69",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:0:6-3:6:12",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:0:6-3:1:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
|
|
@ -47,7 +93,7 @@
|
|||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:2:4-1:6:8",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:2:8-3:6:12",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
|
|
@ -61,7 +107,7 @@
|
|||
"primary": {},
|
||||
"value": {
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:8:10-1:63:65",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:8:14-3:63:69",
|
||||
"value": [
|
||||
{
|
||||
"string": "https://icons.terrastruct.com/essentials/142-target.svg",
|
||||
|
|
@ -71,29 +117,6 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"map_key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:66-2:1:67",
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:66-2:1:67",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:66-2:1:67",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
"raw_string": "b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"primary": {},
|
||||
"value": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -147,6 +170,26 @@
|
|||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:1:3",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:1:3",
|
||||
"value": [
|
||||
{
|
||||
"string": "a",
|
||||
"raw_string": "a"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_path_index": 0,
|
||||
"map_key_edge_index": -1
|
||||
}
|
||||
],
|
||||
"attributes": {
|
||||
|
|
@ -177,11 +220,11 @@
|
|||
"references": [
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:6:8",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:4-2:1:5",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:0:2-1:1:3",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:4-2:1:5",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
|
|
@ -189,17 +232,6 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,1:2:4-1:6:8",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -208,11 +240,11 @@
|
|||
},
|
||||
{
|
||||
"key": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:66-2:1:67",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:0:6-3:6:12",
|
||||
"path": [
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,2:0:66-2:1:67",
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:0:6-3:1:7",
|
||||
"value": [
|
||||
{
|
||||
"string": "b",
|
||||
|
|
@ -220,6 +252,17 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"unquoted_string": {
|
||||
"range": "d2/testdata/d2oracle/TestMove/slice_style.d2,3:2:8-3:6:12",
|
||||
"value": [
|
||||
{
|
||||
"string": "icon",
|
||||
"raw_string": "icon"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue