fix quoting

This commit is contained in:
Alexander Wang 2025-02-27 17:28:17 -07:00
parent 28cc8d4089
commit 82b33369fa
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
5 changed files with 796 additions and 229 deletions

View file

@ -22,4 +22,5 @@
- fixes panic when `sql_shape` shape value had mixed casing [#2349](https://github.com/terrastruct/d2/pull/2349)
- fixes support for `center` in `d2-config` [#2360](https://github.com/terrastruct/d2/pull/2360)
- fixes panic when comment lines appear in arrays [#2378](https://github.com/terrastruct/d2/pull/2378)
- fixes inconsistencies when objects were double quoted [#2390](https://github.com/terrastruct/d2/pull/2390)
- CLI: fetch and render remote images of mimetype octet-stream correctly [#2370](https://github.com/terrastruct/d2/pull/2370)

View file

@ -5462,6 +5462,15 @@ a.width: 339
`, ``)
},
},
{
name: "mixed-edge-quoting",
run: func(t *testing.T) {
g, _ := assertCompile(t, `
"a"."b"."c"."z1" -> "a"."b"."c"."z2"
`, ``)
assert.Equal(t, 5, len(g.Objects))
},
},
}
for _, tc := range tca {

View file

@ -758,8 +758,10 @@ func (m *Map) getField(ida []d2ast.String) *Field {
if !strings.EqualFold(f.Name.ScalarString(), s.ScalarString()) {
continue
}
if f.Name.IsUnquoted() != s.IsUnquoted() {
continue
if _, isReserved := d2ast.ReservedKeywords[strings.ToLower(s.ScalarString())]; isReserved {
if f.Name.IsUnquoted() != s.IsUnquoted() {
continue
}
}
if len(rest) == 0 {
return f
@ -912,9 +914,14 @@ func (m *Map) ensureField(i int, kp *d2ast.KeyPath, refctx *RefContext, create b
}
for _, f := range m.Fields {
if !(f.Name != nil && strings.EqualFold(f.Name.ScalarString(), head.ScalarString()) && f.Name.IsUnquoted() == head.IsUnquoted()) {
if !(f.Name != nil && strings.EqualFold(f.Name.ScalarString(), head.ScalarString())) {
continue
}
if _, isReserved := d2ast.ReservedKeywords[strings.ToLower(f.Name.ScalarString())]; isReserved {
if f.Name.IsUnquoted() != head.IsUnquoted() {
continue
}
}
// Don't add references for fake common KeyPath from trimCommon in CreateEdge.
if refctx != nil {

View file

@ -3,63 +3,40 @@
"name": "",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,0:0:0-7:0:78",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,0:0:0-6:0:65",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:6:7",
"edges": [
{
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:6:7",
"src": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:1:2",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:1:2",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:3:4",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:3:4",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:3:4",
"value": [
{
"string": "a",
"raw_string": "a"
}
}
]
},
"src_arrow": "",
"dst": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:5:6-1:6:7",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:5:6-1:6:7",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
}
]
},
"dst_arrow": ">"
}
],
]
}
}
]
},
"primary": {},
"value": {}
}
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:0:8-2:23:31",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:0:5-2:23:28",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:0:8-2:20:28",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:0:5-2:20:25",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:0:8-2:1:9",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:0:5-2:1:6",
"value": [
{
"string": "*",
@ -73,7 +50,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:2:10-2:7:15",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:2:7-2:7:12",
"value": [
{
"string": "style",
@ -84,7 +61,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:8:16-2:20:28",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:8:13-2:20:25",
"value": [
{
"string": "stroke-width",
@ -98,7 +75,7 @@
"primary": {},
"value": {
"number": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:22:30-2:23:31",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,2:22:27-2:23:28",
"raw": "2",
"value": "2"
}
@ -107,13 +84,13 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:0:32-3:21:53",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:0:29-3:21:50",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:0:32-3:17:49",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:0:29-3:17:46",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:0:32-3:1:33",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:0:29-3:1:30",
"value": [
{
"string": "*",
@ -127,7 +104,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:2:34-3:7:39",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:2:31-3:7:36",
"value": [
{
"string": "style",
@ -138,7 +115,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:8:40-3:17:49",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:8:37-3:17:46",
"value": [
{
"string": "font-size",
@ -152,7 +129,7 @@
"primary": {},
"value": {
"number": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:19:51-3:21:53",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,3:19:48-3:21:50",
"raw": "14",
"value": "14"
}
@ -161,13 +138,13 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:55-5:10:65",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:52-5:12:64",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:55-5:5:60",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:52-5:7:59",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:55-5:1:56",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:52-5:1:53",
"value": [
{
"string": "a",
@ -178,11 +155,11 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:2:57-5:5:60",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:2:54-5:7:59",
"value": [
{
"string": "top",
"raw_string": "top"
"string": "width",
"raw_string": "width"
}
]
}
@ -192,47 +169,7 @@
"primary": {},
"value": {
"number": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:7:62-5:10:65",
"raw": "339",
"value": "339"
}
}
}
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:0:66-6:11:77",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:0:66-6:6:72",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:0:66-6:1:67",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:2:68-6:6:72",
"value": [
{
"string": "left",
"raw_string": "left"
}
]
}
}
]
},
"primary": {},
"value": {
"number": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:8:74-6:11:77",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:9:61-5:12:64",
"raw": "339",
"value": "339"
}
@ -264,102 +201,19 @@
},
"zIndex": 0
},
"edges": [
{
"index": 0,
"isCurve": false,
"src_arrow": false,
"dst_arrow": true,
"references": [
{
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": ""
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": ""
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
}
],
"edges": null,
"objects": [
{
"id": "b",
"id_val": "b",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:1:2",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:1:2",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "b"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {
"strokeWidth": {
"value": "2"
},
"fontSize": {
"value": "14"
}
},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
},
{
"id": "a",
"id_val": "a",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:5:6-1:6:7",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:3:4",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:5:6-1:6:7",
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,1:0:1-1:3:4",
"value": [
{
"string": "a",
@ -371,46 +225,15 @@
]
},
"key_path_index": 0,
"map_key_edge_index": 0
},
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:55-5:5:60",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:55-5:1:56",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:2:57-5:5:60",
"value": [
{
"string": "top",
"raw_string": "top"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": -1
},
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:0:66-6:6:72",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:52-5:7:59",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:0:66-6:1:67",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:0:52-5:1:53",
"value": [
{
"string": "a",
@ -421,11 +244,11 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,6:2:68-6:6:72",
"range": "d2/testdata/d2compiler/TestCompile2/globs/merge-glob-values.d2,5:2:54-5:7:59",
"value": [
{
"string": "left",
"raw_string": "left"
"string": "width",
"raw_string": "width"
}
]
}
@ -452,10 +275,7 @@
"value": "14"
}
},
"top": {
"value": "339"
},
"left": {
"width": {
"value": "339"
},
"near_key": null,

View file

@ -0,0 +1,730 @@
{
"graph": {
"name": "",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,0:0:0-2:0:38",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:36:37",
"edges": [
{
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:36:37",
"src": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:16:17",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:3:4",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:4:5-1:7:8",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:8:9-1:11:12",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:12:13-1:16:17",
"value": [
{
"string": "z1",
"raw_string": "z1"
}
]
}
}
]
},
"src_arrow": "",
"dst": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:36:37",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:23:24",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:24:25-1:27:28",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:28:29-1:31:32",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:32:33-1:36:37",
"value": [
{
"string": "z2",
"raw_string": "z2"
}
]
}
}
]
},
"dst_arrow": ">"
}
],
"primary": {},
"value": {}
}
}
]
},
"root": {
"id": "",
"id_val": "",
"attributes": {
"label": {
"value": ""
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": ""
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
},
"edges": [
{
"index": 0,
"isCurve": false,
"src_arrow": false,
"dst_arrow": true,
"references": [
{
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": ""
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": ""
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
}
],
"objects": [
{
"id": "a",
"id_val": "a",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:16:17",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:3:4",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:4:5-1:7:8",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:8:9-1:11:12",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:12:13-1:16:17",
"value": [
{
"string": "z1",
"raw_string": "z1"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": 0
},
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:36:37",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:23:24",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:24:25-1:27:28",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:28:29-1:31:32",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:32:33-1:36:37",
"value": [
{
"string": "z2",
"raw_string": "z2"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "a"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
},
{
"id": "b",
"id_val": "b",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:16:17",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:3:4",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:4:5-1:7:8",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:8:9-1:11:12",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:12:13-1:16:17",
"value": [
{
"string": "z1",
"raw_string": "z1"
}
]
}
}
]
},
"key_path_index": 1,
"map_key_edge_index": 0
},
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:36:37",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:23:24",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:24:25-1:27:28",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:28:29-1:31:32",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:32:33-1:36:37",
"value": [
{
"string": "z2",
"raw_string": "z2"
}
]
}
}
]
},
"key_path_index": 1,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "b"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
},
{
"id": "c",
"id_val": "c",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:16:17",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:3:4",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:4:5-1:7:8",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:8:9-1:11:12",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:12:13-1:16:17",
"value": [
{
"string": "z1",
"raw_string": "z1"
}
]
}
}
]
},
"key_path_index": 2,
"map_key_edge_index": 0
},
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:36:37",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:23:24",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:24:25-1:27:28",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:28:29-1:31:32",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:32:33-1:36:37",
"value": [
{
"string": "z2",
"raw_string": "z2"
}
]
}
}
]
},
"key_path_index": 2,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "c"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
},
{
"id": "z1",
"id_val": "z1",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:16:17",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:0:1-1:3:4",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:4:5-1:7:8",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:8:9-1:11:12",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:12:13-1:16:17",
"value": [
{
"string": "z1",
"raw_string": "z1"
}
]
}
}
]
},
"key_path_index": 3,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "z1"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
},
{
"id": "z2",
"id_val": "z2",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:36:37",
"path": [
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:20:21-1:23:24",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:24:25-1:27:28",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:28:29-1:31:32",
"value": [
{
"string": "c",
"raw_string": "c"
}
]
}
},
{
"double_quoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/globs/mixed-edge-quoting.d2,1:32:33-1:36:37",
"value": [
{
"string": "z2",
"raw_string": "z2"
}
]
}
}
]
},
"key_path_index": 3,
"map_key_edge_index": 0
}
],
"attributes": {
"label": {
"value": "z2"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
}
]
},
"err": null
}