diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 40813de70c..be155a4c3c 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -1205,7 +1205,7 @@ func (c *compiler) validateBoardLinks(g *d2graph.Graph) { } if !hasBoard(g.RootBoard(), linkKey.IDA()) { - c.errorf(obj.Link.MapKey, "linked board not found") + obj.Link = nil continue } } diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 50ac80cc4e..06e2c67fe1 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -2288,7 +2288,9 @@ scenarios: { name: "link-board-not-found", text: `x.link: layers.x `, - expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:1: linked board not found`, + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, (*d2graph.Scalar)(nil), g.Objects[0].Link) + }, }, { name: "link-board-not-board", @@ -2299,7 +2301,10 @@ layers: { y } }`, - expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:1: linked board not found`, + + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, (*d2graph.Scalar)(nil), g.Objects[0].Link) + }, }, { name: "link-board-nested", @@ -2394,7 +2399,9 @@ layers: { } } }`, - expErr: `d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:9: linked board not found`, + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, (*d2graph.Scalar)(nil), g.Layers[0].Layers[0].Objects[0].Link) + }, }, { name: "import-icon-near", diff --git a/testdata/d2compiler/TestCompile/link-board-not-board.exp.json b/testdata/d2compiler/TestCompile/link-board-not-board.exp.json index 0cac846530..3d1d8ee0f2 100644 --- a/testdata/d2compiler/TestCompile/link-board-not-board.exp.json +++ b/testdata/d2compiler/TestCompile/link-board-not-board.exp.json @@ -1,11 +1,391 @@ { - "graph": null, - "err": { - "errs": [ + "graph": { + "name": "", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,0:0:0-6:1:51", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,0:0:0-0:3:3", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,0:0:0-0:3:3", + "value": [ + { + "string": "zzz", + "raw_string": "zzz" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:0:4-1:18:22", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:0:4-1:6:10", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:0:4-1:1:5", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:2:6-1:6:10", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:8:12-1:18:22", + "value": [ + { + "string": "layers.x.y", + "raw_string": "layers.x.y" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,2:0:23-6:1:51", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,2:0:23-2:6:29", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,2:0:23-2:6:29", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,2:8:31-6:1:51", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,3:2:35-5:3:49", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,3:2:35-3:3:36", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,3:2:35-3:3:36", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,3:5:38-5:3:49", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,4:4:44-4:5:45", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,4:4:44-4:5:45", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,4:4:44-4:5:45", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "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": null, + "objects": [ { - "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:0:4-1:18:22", - "errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:1: linked board not found" + "id": "zzz", + "id_val": "zzz", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,0:0:0-0:3:3", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,0:0:0-0:3:3", + "value": [ + { + "string": "zzz", + "raw_string": "zzz" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "zzz" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + }, + { + "id": "x", + "id_val": "x", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:0:4-1:6:10", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:0:4-1:1:5", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:2:6-1:6:10", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + } + ], + "layers": [ + { + "name": "x", + "isFolderOnly": false, + "ast": { + "range": ",0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "y" + } + ] + } + } + ] + }, + "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": null, + "objects": [ + { + "id": "y", + "id_val": "y", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,4:4:44-4:5:45", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,4:4:44-4:5:45", + "value": [ + { + "string": "y", + "raw_string": "y" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "y" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + } + ] } ] - } + }, + "err": null } diff --git a/testdata/d2compiler/TestCompile/link-board-not-found.exp.json b/testdata/d2compiler/TestCompile/link-board-not-found.exp.json index f448bcd364..6a05f45076 100644 --- a/testdata/d2compiler/TestCompile/link-board-not-found.exp.json +++ b/testdata/d2compiler/TestCompile/link-board-not-found.exp.json @@ -1,11 +1,138 @@ { - "graph": null, - "err": { - "errs": [ + "graph": { + "name": "", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-1:0:17", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-0:16:16", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:2:2-0:6:6", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:8:8-0:16:16", + "value": [ + { + "string": "layers.x", + "raw_string": "layers.x" + } + ] + } + } + } + } + ] + }, + "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": null, + "objects": [ { - "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-0:16:16", - "errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:1: linked board not found" + "id": "x", + "id_val": "x", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:2:2-0:6:6", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 } ] - } + }, + "err": null } diff --git a/testdata/d2compiler/TestCompile/link-board-underscore-not-found.exp.json b/testdata/d2compiler/TestCompile/link-board-underscore-not-found.exp.json index 2cd9f97dfa..f266a391c1 100644 --- a/testdata/d2compiler/TestCompile/link-board-underscore-not-found.exp.json +++ b/testdata/d2compiler/TestCompile/link-board-underscore-not-found.exp.json @@ -1,11 +1,660 @@ { - "graph": null, - "err": { - "errs": [ + "graph": { + "name": "", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,0:0:0-10:1:96", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,0:0:0-0:1:1", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,1:0:2-10:1:96", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,1:0:2-1:6:8", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,1:0:2-1:6:8", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,1:8:10-10:1:96", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,2:2:14-9:3:94", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,2:2:14-2:3:15", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,2:2:14-2:3:15", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,2:5:17-9:3:94", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,3:4:23-3:6:25", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,3:4:23-3:6:25", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,3:4:23-3:6:25", + "value": [ + { + "string": "yo", + "raw_string": "yo" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,4:4:30-8:5:90", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,4:4:30-4:10:36", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,4:4:30-4:10:36", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,4:12:38-8:5:90", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,5:6:46-7:7:84", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,5:6:46-5:7:47", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,5:6:46-5:7:47", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,5:9:49-7:7:84", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:8:59-6:25:76", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:8:59-6:18:69", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:8:59-6:13:64", + "value": [ + { + "string": "hello", + "raw_string": "hello" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:14:65-6:18:69", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:20:71-6:25:76", + "value": [ + { + "string": "_._._", + "raw_string": "_._._" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "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": null, + "objects": [ { - "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:8:59-6:25:76", - "errmsg": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:9: linked board not found" + "id": "x", + "id_val": "x", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,0:0:0-0:1:1", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "x" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + } + ], + "layers": [ + { + "name": "x", + "isFolderOnly": false, + "ast": { + "range": ",0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "yo" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + }, + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": ",0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": ",0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "hello" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": ",0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "link" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "root._" + } + ] + } + }, + "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": null, + "objects": [ + { + "id": "yo", + "id_val": "yo", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,3:4:23-3:6:25", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,3:4:23-3:6:25", + "value": [ + { + "string": "yo", + "raw_string": "yo" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "yo" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + } + ], + "layers": [ + { + "name": "x", + "isFolderOnly": false, + "ast": { + "range": ",0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "hello" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": ",0:0:0-1:0:0", + "nodes": [ + { + "map_key": { + "range": ",0:0:0-0:0:0", + "key": { + "range": ",0:0:0-0:0:0", + "path": [ + { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "link" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": ",0:0:0-0:0:0", + "value": [ + { + "string": "root._" + } + ] + } + }, + "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": null, + "objects": [ + { + "id": "hello", + "id_val": "hello", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:8:59-6:18:69", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:8:59-6:13:64", + "value": [ + { + "string": "hello", + "raw_string": "hello" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:14:65-6:18:69", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "hello" + }, + "labelDimensions": { + "width": 0, + "height": 0 + }, + "style": {}, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": null + }, + "zIndex": 0 + } + ] + } + ] } ] - } + }, + "err": null }