diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 584dd20af..e0e99d1c6 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -71,6 +71,9 @@ func (c *compiler) compileBoard(g *d2graph.Graph, ir *d2ir.Map) *d2graph.Graph { c.compileBoardsField(g, ir, "layers") c.compileBoardsField(g, ir, "scenarios") c.compileBoardsField(g, ir, "steps") + + c.validateBoardLink(g, ir) + return g } @@ -275,7 +278,9 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) { attrs.Height.Value = scalar.ScalarString() attrs.Height.MapKey = f.LastPrimaryKey() case "link": - attrs.Link = scalar.ScalarString() + attrs.Link.Value = scalar.ScalarString() + attrs.Link.MapKey = f.LastPrimaryKey() + attrs.Link.MapKey.Range = scalar.GetRange() case "direction": dirs := []string{"up", "down", "right", "left"} if !go2.Contains(dirs, scalar.ScalarString()) { @@ -646,6 +651,39 @@ func (c *compiler) validateNear(g *d2graph.Graph) { } } +func (c *compiler) validateBoardLink(g *d2graph.Graph, ir *d2ir.Map) { + for _, obj := range g.Objects { + if obj.Attributes.Link.Value == "" { + continue + } + + linkKey, err := d2parser.ParseKey(obj.Attributes.Link.Value) + // Links can be urls + if err != nil { + continue + } + + // If the keyword is not another board, don't validate + // Might just be linking to a local folder + switch linkKey.Path[0].Unbox().ScalarString() { + case "layers", "scenarios", "steps": + default: + continue + } + + b := ir.GetField(linkKey.IDA()...) + if b == nil { + c.errorf(obj.Attributes.Link.MapKey, "link key %#v to board not found", obj.Attributes.Link.Value) + continue + } + kind := d2ir.NodeBoardKind(b) + if kind == "" { + c.errorf(obj.Attributes.Link.MapKey, "internal link key %#v is not a top-level board", obj.Attributes.Link.Value) + continue + } + } +} + func init() { FullToShortLanguageAliases = make(map[string]string, len(ShortToFullLanguageAliases)) for k, v := range ShortToFullLanguageAliases { diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 37e68632c..50c1ef32e 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1351,8 +1351,8 @@ x -> y: { if len(g.Objects) != 1 { t.Fatal(g.Objects) } - if g.Objects[0].Attributes.Link != "https://google.com" { - t.Fatal(g.Objects[0].Attributes.Link) + if g.Objects[0].Attributes.Link.Value != "https://google.com" { + t.Fatal(g.Objects[0].Attributes.Link.Value) } }, }, @@ -1367,8 +1367,8 @@ x -> y: { if len(g.Objects) != 1 { t.Fatal(g.Objects) } - if g.Objects[0].Attributes.Link != "Overview.Untitled board 7.zzzzz" { - t.Fatal(g.Objects[0].Attributes.Link) + if g.Objects[0].Attributes.Link.Value != "Overview.Untitled board 7.zzzzz" { + t.Fatal(g.Objects[0].Attributes.Link.Value) } }, }, @@ -1899,6 +1899,41 @@ Chinchillas_Collectibles.chinchilla -> Chinchillas.id`, tassert.Equal(t, 2, *g.Edges[0].SrcTableColumnIndex) }, }, + { + name: "link-board-ok", + text: `x.link: layers.x +layers: { + x +}`, + }, + { + name: "link-board-not-found", + text: `x.link: layers.x +`, + expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:9: link key "layers.x" to board not found`, + }, + { + name: "link-board-not-board", + text: `zzz +x.link: layers.x.y +layers: { + x: { + y + } +}`, + expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:9: internal link key "layers.x.y" is not a top-level board`, + }, + { + name: "link-board-nested", + text: `x.link: layers.x.layers.x +layers: { + x: { + layers: { + x + } + } +}`, + }, } for _, tc := range testCases { diff --git a/d2exporter/export.go b/d2exporter/export.go index 5a57f0881..3f4989b21 100644 --- a/d2exporter/export.go +++ b/d2exporter/export.go @@ -150,7 +150,7 @@ func toShape(obj *d2graph.Object, theme *d2themes.Theme) d2target.Shape { } shape.Tooltip = obj.Attributes.Tooltip - shape.Link = obj.Attributes.Link + shape.Link = obj.Attributes.Link.Value shape.Icon = obj.Attributes.Icon if obj.IconPosition != nil { shape.IconPosition = *obj.IconPosition diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index f74b14496..4b2ed84a8 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -96,7 +96,7 @@ type Attributes struct { Style Style `json:"style"` Icon *url.URL `json:"icon,omitempty"` Tooltip string `json:"tooltip,omitempty"` - Link string `json:"link,omitempty"` + Link Scalar `json:"link"` // Only applicable for images right now Width *Scalar `json:"width,omitempty"` @@ -1263,7 +1263,7 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler switch shapeType { case shape.TABLE_TYPE, shape.CLASS_TYPE, shape.CODE_TYPE, shape.IMAGE_TYPE: default: - if obj.Attributes.Link != "" { + if obj.Attributes.Link.Value != "" { paddingX += 32 } if obj.Attributes.Tooltip != "" { diff --git a/testdata/d2compiler/TestCompile/basic_icon.exp.json b/testdata/d2compiler/TestCompile/basic_icon.exp.json index d4588e787..a3b570bd7 100644 --- a/testdata/d2compiler/TestCompile/basic_icon.exp.json +++ b/testdata/d2compiler/TestCompile/basic_icon.exp.json @@ -85,6 +85,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -146,6 +149,9 @@ "Fragment": "", "RawFragment": "" }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/basic_sequence.exp.json b/testdata/d2compiler/TestCompile/basic_sequence.exp.json index 74535d9b3..786168eb5 100644 --- a/testdata/d2compiler/TestCompile/basic_sequence.exp.json +++ b/testdata/d2compiler/TestCompile/basic_sequence.exp.json @@ -80,6 +80,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -129,6 +132,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sequence_diagram" diff --git a/testdata/d2compiler/TestCompile/basic_shape.exp.json b/testdata/d2compiler/TestCompile/basic_shape.exp.json index a519d65a1..7b2266f7a 100644 --- a/testdata/d2compiler/TestCompile/basic_shape.exp.json +++ b/testdata/d2compiler/TestCompile/basic_shape.exp.json @@ -80,6 +80,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -129,6 +132,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "circle" diff --git a/testdata/d2compiler/TestCompile/basic_style.exp.json b/testdata/d2compiler/TestCompile/basic_style.exp.json index fb33638ba..d278ad24d 100644 --- a/testdata/d2compiler/TestCompile/basic_style.exp.json +++ b/testdata/d2compiler/TestCompile/basic_style.exp.json @@ -87,6 +87,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -140,6 +143,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/class_paren.exp.json b/testdata/d2compiler/TestCompile/class_paren.exp.json index 68fb7cf19..3931f4558 100644 --- a/testdata/d2compiler/TestCompile/class_paren.exp.json +++ b/testdata/d2compiler/TestCompile/class_paren.exp.json @@ -179,6 +179,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -249,6 +252,9 @@ "value": "shape" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "class" diff --git a/testdata/d2compiler/TestCompile/class_style.exp.json b/testdata/d2compiler/TestCompile/class_style.exp.json index 1d39a3212..8dd910add 100644 --- a/testdata/d2compiler/TestCompile/class_style.exp.json +++ b/testdata/d2compiler/TestCompile/class_style.exp.json @@ -153,6 +153,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -216,6 +219,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "class" diff --git a/testdata/d2compiler/TestCompile/constraint_label.exp.json b/testdata/d2compiler/TestCompile/constraint_label.exp.json index 5e917a018..c948a2127 100644 --- a/testdata/d2compiler/TestCompile/constraint_label.exp.json +++ b/testdata/d2compiler/TestCompile/constraint_label.exp.json @@ -113,6 +113,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -162,6 +165,9 @@ "value": "bar" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/default_direction.exp.json b/testdata/d2compiler/TestCompile/default_direction.exp.json index 072ac22af..b3c7e8526 100644 --- a/testdata/d2compiler/TestCompile/default_direction.exp.json +++ b/testdata/d2compiler/TestCompile/default_direction.exp.json @@ -41,6 +41,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -90,6 +93,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/dimension_with_style.exp.json b/testdata/d2compiler/TestCompile/dimension_with_style.exp.json index 9f346789d..f410ea0ba 100644 --- a/testdata/d2compiler/TestCompile/dimension_with_style.exp.json +++ b/testdata/d2compiler/TestCompile/dimension_with_style.exp.json @@ -115,6 +115,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -168,6 +171,9 @@ "value": "true" } }, + "link": { + "value": "" + }, "width": { "value": "200" }, diff --git a/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json b/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json index 27d605bfa..a1822b4c4 100644 --- a/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json +++ b/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json @@ -143,6 +143,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -192,6 +195,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "width": { "value": "200" }, diff --git a/testdata/d2compiler/TestCompile/edge.exp.json b/testdata/d2compiler/TestCompile/edge.exp.json index 636b4fb3d..a452dafd1 100644 --- a/testdata/d2compiler/TestCompile/edge.exp.json +++ b/testdata/d2compiler/TestCompile/edge.exp.json @@ -64,6 +64,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -99,6 +102,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -148,6 +154,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -195,6 +204,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json b/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json index 02147eba1..028f4c36c 100644 --- a/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json +++ b/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json @@ -243,6 +243,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -272,6 +275,9 @@ "value": "Reisner's Rule of Conceptual Inertia" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "diamond" @@ -293,6 +299,9 @@ "value": "true" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -314,6 +323,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -363,6 +375,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -410,6 +425,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_chain.exp.json b/testdata/d2compiler/TestCompile/edge_chain.exp.json index 124bbc7f0..c67619e4d 100644 --- a/testdata/d2compiler/TestCompile/edge_chain.exp.json +++ b/testdata/d2compiler/TestCompile/edge_chain.exp.json @@ -111,6 +111,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -146,6 +149,9 @@ "value": "The kids will love our inflatable slides" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -180,6 +186,9 @@ "value": "The kids will love our inflatable slides" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -229,6 +238,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -296,6 +308,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -343,6 +358,9 @@ "value": "z" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_chain_map.exp.json b/testdata/d2compiler/TestCompile/edge_chain_map.exp.json index dd7ea9f90..8627ffc72 100644 --- a/testdata/d2compiler/TestCompile/edge_chain_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_chain_map.exp.json @@ -140,6 +140,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -175,6 +178,9 @@ "value": "Space: the final frontier. These are the voyages of the starship Enterprise." }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -209,6 +215,9 @@ "value": "Space: the final frontier. These are the voyages of the starship Enterprise." }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -258,6 +267,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -325,6 +337,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -372,6 +387,9 @@ "value": "z" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_column_index.exp.json b/testdata/d2compiler/TestCompile/edge_column_index.exp.json index 22fb0bf42..be203773c 100644 --- a/testdata/d2compiler/TestCompile/edge_column_index.exp.json +++ b/testdata/d2compiler/TestCompile/edge_column_index.exp.json @@ -342,6 +342,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -379,6 +382,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -519,6 +525,9 @@ "value": "src" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" @@ -657,6 +666,9 @@ "value": "dst" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" diff --git a/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json b/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json index 252668201..c27262cb9 100644 --- a/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json +++ b/testdata/d2compiler/TestCompile/edge_exclusive_style.exp.json @@ -109,6 +109,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -148,6 +151,9 @@ "value": "true" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -197,6 +203,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -244,6 +253,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json index d84e0455d..3d4455e77 100644 --- a/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json @@ -152,6 +152,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -181,6 +184,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "diamond" @@ -206,6 +212,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -275,6 +284,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -342,6 +354,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json index 83b5d7183..1a49c8782 100644 --- a/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json @@ -120,6 +120,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -149,6 +152,9 @@ "value": "yo" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -171,6 +177,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -220,6 +229,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -267,6 +279,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_in_column.exp.json b/testdata/d2compiler/TestCompile/edge_in_column.exp.json index 7783ac781..1a3bec53f 100644 --- a/testdata/d2compiler/TestCompile/edge_in_column.exp.json +++ b/testdata/d2compiler/TestCompile/edge_in_column.exp.json @@ -155,6 +155,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -190,6 +193,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -271,6 +277,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" @@ -318,6 +327,9 @@ "value": "p" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -365,6 +377,9 @@ "value": "q" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_index.exp.json b/testdata/d2compiler/TestCompile/edge_index.exp.json index f768c5588..ff223eef4 100644 --- a/testdata/d2compiler/TestCompile/edge_index.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index.exp.json @@ -135,6 +135,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -173,6 +176,9 @@ "value": "two" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -242,6 +248,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -309,6 +318,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_index_map.exp.json b/testdata/d2compiler/TestCompile/edge_index_map.exp.json index 3eff01b38..1155cf901 100644 --- a/testdata/d2compiler/TestCompile/edge_index_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_map.exp.json @@ -154,6 +154,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -192,6 +195,9 @@ "value": "Space: the final frontier. These are the voyages of the starship Enterprise." }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -261,6 +267,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -328,6 +337,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_index_nested.exp.json b/testdata/d2compiler/TestCompile/edge_index_nested.exp.json index 900dde803..8708aa601 100644 --- a/testdata/d2compiler/TestCompile/edge_index_nested.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_nested.exp.json @@ -164,6 +164,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -202,6 +205,9 @@ "value": "two" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -251,6 +257,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -318,6 +327,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -385,6 +397,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json b/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json index 63e0279b7..978148423 100644 --- a/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json @@ -180,6 +180,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -218,6 +221,9 @@ "value": "two" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -287,6 +293,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -354,6 +363,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -421,6 +433,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json index 0d1e24e0e..a93563c2e 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested.exp.json @@ -193,6 +193,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -235,6 +238,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -304,6 +310,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -371,6 +380,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -438,6 +450,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json index c5845edcb..31498cc75 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_flat_nested_underscore.exp.json @@ -199,6 +199,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -241,6 +244,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -290,6 +296,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -337,6 +346,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -384,6 +396,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json index 4069495d1..0920d1f75 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_map_flat_nested_underscore.exp.json @@ -212,6 +212,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -254,6 +257,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -303,6 +309,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -350,6 +359,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -397,6 +409,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json b/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json index b8e131947..4deb3e58d 100644 --- a/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json +++ b/testdata/d2compiler/TestCompile/edge_key_group_map_nested_underscore.exp.json @@ -230,6 +230,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -272,6 +275,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -321,6 +327,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -368,6 +377,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -415,6 +427,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_label_map.exp.json b/testdata/d2compiler/TestCompile/edge_label_map.exp.json index f70133e23..4ca65a2da 100644 --- a/testdata/d2compiler/TestCompile/edge_label_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_label_map.exp.json @@ -120,6 +120,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -159,6 +162,9 @@ "value": "0.5" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -208,6 +214,9 @@ "value": "hey y9" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -255,6 +264,9 @@ "value": "qwer" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_map.exp.json b/testdata/d2compiler/TestCompile/edge_map.exp.json index 0901560aa..d696404e7 100644 --- a/testdata/d2compiler/TestCompile/edge_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map.exp.json @@ -103,6 +103,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -138,6 +141,9 @@ "value": "Space: the final frontier. These are the voyages of the starship Enterprise." }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -187,6 +193,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -234,6 +243,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json index 7ab789ec0..6153ccce7 100644 --- a/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json @@ -132,6 +132,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -161,6 +164,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "diamond" @@ -183,6 +189,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -232,6 +241,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -279,6 +291,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json b/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json index ef4b689aa..d20399edf 100644 --- a/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_group_flat.exp.json @@ -148,6 +148,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -190,6 +193,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -259,6 +265,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -326,6 +335,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json b/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json index 13da7398c..fb1ea295e 100644 --- a/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_group_semiflat.exp.json @@ -166,6 +166,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -208,6 +211,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -277,6 +283,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -344,6 +353,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_map_nested.exp.json b/testdata/d2compiler/TestCompile/edge_map_nested.exp.json index e51525ab6..42dd5da05 100644 --- a/testdata/d2compiler/TestCompile/edge_map_nested.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_nested.exp.json @@ -128,6 +128,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -167,6 +170,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -216,6 +222,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -263,6 +272,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json b/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json index a7541c459..09b0f036a 100644 --- a/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_nested_flat.exp.json @@ -110,6 +110,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -149,6 +152,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -198,6 +204,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -245,6 +254,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json index bbc7e6603..1e4f587b5 100644 --- a/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json @@ -220,6 +220,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -249,6 +252,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "diamond" @@ -266,6 +272,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "diamond" @@ -290,6 +299,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -359,6 +371,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -426,6 +441,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json index ec7a39906..88b241d6c 100644 --- a/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json @@ -114,6 +114,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -143,6 +146,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "triangle" @@ -165,6 +171,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -214,6 +223,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -261,6 +273,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json index bd9108533..d177c105f 100644 --- a/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json @@ -170,6 +170,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -199,6 +202,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "diamond" @@ -224,6 +230,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -293,6 +302,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -360,6 +372,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/escaped_id.exp.json b/testdata/d2compiler/TestCompile/escaped_id.exp.json index bdb71deb0..9fcce910e 100644 --- a/testdata/d2compiler/TestCompile/escaped_id.exp.json +++ b/testdata/d2compiler/TestCompile/escaped_id.exp.json @@ -41,6 +41,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -90,6 +93,9 @@ "value": "b\nb" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/image_style.exp.json b/testdata/d2compiler/TestCompile/image_style.exp.json index ffc9aea3f..54a03f948 100644 --- a/testdata/d2compiler/TestCompile/image_style.exp.json +++ b/testdata/d2compiler/TestCompile/image_style.exp.json @@ -162,6 +162,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -227,6 +230,9 @@ "Fragment": "", "RawFragment": "" }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "image" diff --git a/testdata/d2compiler/TestCompile/link-board-nested.exp.json b/testdata/d2compiler/TestCompile/link-board-nested.exp.json new file mode 100644 index 000000000..4cac13579 --- /dev/null +++ b/testdata/d2compiler/TestCompile/link-board-nested.exp.json @@ -0,0 +1,451 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-7:1:75", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:8:8-0:25:25", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:2:2-0:6:6", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:8:8-0:25:25", + "value": [ + { + "string": "layers.x.layers.x", + "raw_string": "layers.x.layers.x" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-7:1:75", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-1:6:32", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-1:6:32", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-7:0:74", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-6:3:73", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:4:40-6:2:72", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-5:5:69", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:54-5:4:68", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-4:7:63", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-4:7:63", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-4:7:63", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "link": { + "value": "" + }, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.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" + }, + "style": {}, + "link": { + "value": "layers.x.layers.x" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "layers": [ + { + "name": "x", + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-7:1:75", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:8:8-0:25:25", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:2:2-0:6:6", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:8:8-0:25:25", + "value": [ + { + "string": "layers.x.layers.x", + "raw_string": "layers.x.layers.x" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-7:1:75", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-1:6:32", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-1:6:32", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-7:0:74", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-6:3:73", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:4:40-6:2:72", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-5:5:69", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:54-5:4:68", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-4:7:63", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-4:7:63", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-4:7:63", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "link": { + "value": "" + }, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": null + } + ] + }, + "err": null +} diff --git a/testdata/d2compiler/TestCompile/link-board-not-board.exp.json b/testdata/d2compiler/TestCompile/link-board-not-board.exp.json new file mode 100644 index 000000000..1885fdb6d --- /dev/null +++ b/testdata/d2compiler/TestCompile/link-board-not-board.exp.json @@ -0,0 +1,12 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:8:12-1:18:22", + "errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:9: internal link key \"layers.x.y\" is not a top-level board" + } + ] + } +} diff --git a/testdata/d2compiler/TestCompile/link-board-not-found.exp.json b/testdata/d2compiler/TestCompile/link-board-not-found.exp.json new file mode 100644 index 000000000..8c8509b5d --- /dev/null +++ b/testdata/d2compiler/TestCompile/link-board-not-found.exp.json @@ -0,0 +1,12 @@ +{ + "graph": null, + "err": { + "ioerr": null, + "errs": [ + { + "range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:8:8-0:16:16", + "errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:9: link key \"layers.x\" to board not found" + } + ] + } +} diff --git a/testdata/d2compiler/TestCompile/link-board-ok.exp.json b/testdata/d2compiler/TestCompile/link-board-ok.exp.json new file mode 100644 index 000000000..b6e66ee2f --- /dev/null +++ b/testdata/d2compiler/TestCompile/link-board-ok.exp.json @@ -0,0 +1,199 @@ +{ + "graph": { + "name": "", + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-3:1:32", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:8:8-0:16:16", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:2:2-0:6:6", + "value": [ + { + "string": "link", + "raw_string": "link" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:8:8-0:16:16", + "value": [ + { + "string": "layers.x", + "raw_string": "layers.x" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,1:0:17-3:1:32", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,1:0:17-1:6:23", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,1:0:17-1:6:23", + "value": [ + { + "string": "layers", + "raw_string": "layers" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,1:8:25-3:0:31", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,2:2:29-2:3:30", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,2:2:29-2:3:30", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,2:2:29-2:3:30", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": {} + } + } + ] + } + } + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "link": { + "value": "" + }, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": null, + "objects": [ + { + "id": "x", + "id_val": "x", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:6:6", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:1:1", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/link-board-ok.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" + }, + "style": {}, + "link": { + "value": "layers.x" + }, + "near_key": null, + "shape": { + "value": "rectangle" + }, + "direction": { + "value": "" + }, + "constraint": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": null +} diff --git a/testdata/d2compiler/TestCompile/near_constant.exp.json b/testdata/d2compiler/TestCompile/near_constant.exp.json index 7aa383a8d..9730e36a5 100644 --- a/testdata/d2compiler/TestCompile/near_constant.exp.json +++ b/testdata/d2compiler/TestCompile/near_constant.exp.json @@ -62,6 +62,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -122,6 +125,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": { "range": "d2/testdata/d2compiler/TestCompile/near_constant.d2,0:8:8-0:18:18", "path": [ diff --git a/testdata/d2compiler/TestCompile/nested_sql.exp.json b/testdata/d2compiler/TestCompile/nested_sql.exp.json index cbd905feb..24399cd47 100644 --- a/testdata/d2compiler/TestCompile/nested_sql.exp.json +++ b/testdata/d2compiler/TestCompile/nested_sql.exp.json @@ -175,6 +175,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -224,6 +227,9 @@ "value": "outer" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -331,6 +337,9 @@ "value": "table" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" diff --git a/testdata/d2compiler/TestCompile/null.exp.json b/testdata/d2compiler/TestCompile/null.exp.json index 35d0e55fb..a8245a1a2 100644 --- a/testdata/d2compiler/TestCompile/null.exp.json +++ b/testdata/d2compiler/TestCompile/null.exp.json @@ -41,6 +41,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -90,6 +93,9 @@ "value": "null" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/path_link.exp.json b/testdata/d2compiler/TestCompile/path_link.exp.json index 9a1cb6fc3..284e04b66 100644 --- a/testdata/d2compiler/TestCompile/path_link.exp.json +++ b/testdata/d2compiler/TestCompile/path_link.exp.json @@ -30,7 +30,7 @@ "nodes": [ { "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:2:7-1:39:44", + "range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:8:13-1:39:44", "key": { "range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:2:7-1:6:11", "path": [ @@ -80,6 +80,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -129,7 +132,9 @@ "value": "x" }, "style": {}, - "link": "Overview.Untitled board 7.zzzzz", + "link": { + "value": "Overview.Untitled board 7.zzzzz" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json b/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json index b5e89869b..2bf17c279 100644 --- a/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json +++ b/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json @@ -275,6 +275,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -377,6 +380,9 @@ "Fragment": "", "RawFragment": "" }, + "link": { + "value": "" + }, "near_key": { "range": "d2/testdata/d2compiler/TestCompile/reserved_icon_near_style.d2,6:8:90-6:9:91", "path": [ @@ -439,6 +445,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/root_direction.exp.json b/testdata/d2compiler/TestCompile/root_direction.exp.json index 7f854e01c..ed46978ad 100644 --- a/testdata/d2compiler/TestCompile/root_direction.exp.json +++ b/testdata/d2compiler/TestCompile/root_direction.exp.json @@ -51,6 +51,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" diff --git a/testdata/d2compiler/TestCompile/root_sequence.exp.json b/testdata/d2compiler/TestCompile/root_sequence.exp.json index 3b18c9b7f..edeebea23 100644 --- a/testdata/d2compiler/TestCompile/root_sequence.exp.json +++ b/testdata/d2compiler/TestCompile/root_sequence.exp.json @@ -51,6 +51,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sequence_diagram" diff --git a/testdata/d2compiler/TestCompile/self-referencing.exp.json b/testdata/d2compiler/TestCompile/self-referencing.exp.json index e5769bdfb..fbfee35ca 100644 --- a/testdata/d2compiler/TestCompile/self-referencing.exp.json +++ b/testdata/d2compiler/TestCompile/self-referencing.exp.json @@ -64,6 +64,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -99,6 +102,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -168,6 +174,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/sequence_container.exp.json b/testdata/d2compiler/TestCompile/sequence_container.exp.json index a561fc72f..62cfb63a6 100644 --- a/testdata/d2compiler/TestCompile/sequence_container.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_container.exp.json @@ -260,6 +260,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sequence_diagram" @@ -295,6 +298,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -329,6 +335,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -442,6 +451,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -553,6 +565,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -664,6 +679,9 @@ "value": "q" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -775,6 +793,9 @@ "value": "j" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -886,6 +907,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -997,6 +1021,9 @@ "value": "p" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -1044,6 +1071,9 @@ "value": "ok" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/sequence_container_2.exp.json b/testdata/d2compiler/TestCompile/sequence_container_2.exp.json index 4674302c5..4b8abe15a 100644 --- a/testdata/d2compiler/TestCompile/sequence_container_2.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_container_2.exp.json @@ -238,6 +238,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sequence_diagram" @@ -273,6 +276,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -386,6 +392,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -497,6 +506,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -608,6 +620,9 @@ "value": "q" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -655,6 +670,9 @@ "value": "ok" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -724,6 +742,9 @@ "value": "j" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -793,6 +814,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -862,6 +886,9 @@ "value": "p" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -909,6 +936,9 @@ "value": "meow" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json b/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json index aa5093e97..f19e60e11 100644 --- a/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json @@ -160,6 +160,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sequence_diagram" @@ -209,6 +212,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -287,6 +293,9 @@ "value": "d" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -334,6 +343,9 @@ "value": "choo" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -392,6 +404,9 @@ "value": "this note" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/sequence_scoping.exp.json b/testdata/d2compiler/TestCompile/sequence_scoping.exp.json index 02af6b56a..c0cf20990 100644 --- a/testdata/d2compiler/TestCompile/sequence_scoping.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_scoping.exp.json @@ -348,6 +348,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -383,6 +386,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -417,6 +423,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -451,6 +460,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -500,6 +512,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sequence_diagram" @@ -598,6 +613,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -769,6 +787,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -816,6 +837,9 @@ "value": "group" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -874,6 +898,9 @@ "value": "t1" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -1005,6 +1032,9 @@ "value": "t1" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -1074,6 +1104,9 @@ "value": "t2" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/set_direction.exp.json b/testdata/d2compiler/TestCompile/set_direction.exp.json index df116fbee..2c28dd65e 100644 --- a/testdata/d2compiler/TestCompile/set_direction.exp.json +++ b/testdata/d2compiler/TestCompile/set_direction.exp.json @@ -80,6 +80,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -129,6 +132,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json b/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json index bf216c1c2..8ff698d3b 100644 --- a/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json +++ b/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json @@ -114,6 +114,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -163,6 +166,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "height": { "value": "230" }, diff --git a/testdata/d2compiler/TestCompile/sql-regression.exp.json b/testdata/d2compiler/TestCompile/sql-regression.exp.json index 09e889fee..c13eaecb3 100644 --- a/testdata/d2compiler/TestCompile/sql-regression.exp.json +++ b/testdata/d2compiler/TestCompile/sql-regression.exp.json @@ -217,6 +217,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -270,6 +273,9 @@ "value": "lemonchiffon" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -349,6 +355,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" @@ -396,6 +405,9 @@ "value": "d" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/sql_paren.exp.json b/testdata/d2compiler/TestCompile/sql_paren.exp.json index c61a984fa..9b94f34b0 100644 --- a/testdata/d2compiler/TestCompile/sql_paren.exp.json +++ b/testdata/d2compiler/TestCompile/sql_paren.exp.json @@ -156,6 +156,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -265,6 +268,9 @@ "value": "shape" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" diff --git a/testdata/d2compiler/TestCompile/stroke-width.exp.json b/testdata/d2compiler/TestCompile/stroke-width.exp.json index 6479ada26..5e58364b5 100644 --- a/testdata/d2compiler/TestCompile/stroke-width.exp.json +++ b/testdata/d2compiler/TestCompile/stroke-width.exp.json @@ -87,6 +87,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -140,6 +143,9 @@ "value": "0" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/table_connection_attr.exp.json b/testdata/d2compiler/TestCompile/table_connection_attr.exp.json index 8ec78e2da..7f75f846f 100644 --- a/testdata/d2compiler/TestCompile/table_connection_attr.exp.json +++ b/testdata/d2compiler/TestCompile/table_connection_attr.exp.json @@ -301,6 +301,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -342,6 +345,9 @@ "value": "true" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -454,6 +460,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" @@ -564,6 +573,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" diff --git a/testdata/d2compiler/TestCompile/table_style.exp.json b/testdata/d2compiler/TestCompile/table_style.exp.json index a7447912c..caf5ba376 100644 --- a/testdata/d2compiler/TestCompile/table_style.exp.json +++ b/testdata/d2compiler/TestCompile/table_style.exp.json @@ -153,6 +153,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -238,6 +241,9 @@ "value": "0.4" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" diff --git a/testdata/d2compiler/TestCompile/table_style_map.exp.json b/testdata/d2compiler/TestCompile/table_style_map.exp.json index a81f2575d..bb2aa5875 100644 --- a/testdata/d2compiler/TestCompile/table_style_map.exp.json +++ b/testdata/d2compiler/TestCompile/table_style_map.exp.json @@ -204,6 +204,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -292,6 +295,9 @@ "value": "blue" } }, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" diff --git a/testdata/d2compiler/TestCompile/underscore_edge.exp.json b/testdata/d2compiler/TestCompile/underscore_edge.exp.json index a44664b67..3780ddb0f 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge.exp.json @@ -115,6 +115,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -150,6 +153,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -230,6 +236,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -288,6 +297,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json index 0f25d4819..3d0f17835 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_chain.exp.json @@ -174,6 +174,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -209,6 +212,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -243,6 +249,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -354,6 +363,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -412,6 +424,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -470,6 +485,9 @@ "value": "z" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json index fbb09bf26..aa3e6be5a 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json @@ -181,6 +181,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -216,6 +219,9 @@ "value": "Can you imagine how life could be improved if we could do away with" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -250,6 +256,9 @@ "value": "Well, it's garish, ugly, and derelicts have used it for a toilet." }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -330,6 +339,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -408,6 +420,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -455,6 +470,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json index b12d10cbd..d70f05bc1 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json @@ -186,6 +186,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -224,6 +227,9 @@ "value": "Well, it's garish, ugly, and derelicts have used it for a toilet." }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -273,6 +279,9 @@ "value": "a" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -320,6 +329,9 @@ "value": "b" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -367,6 +379,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json index 43eb5dd75..4265e3072 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_nested.exp.json @@ -155,6 +155,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -190,6 +193,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -239,6 +245,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -317,6 +326,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -386,6 +398,9 @@ "value": "z" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json index cddc450bb..0726910e8 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_create.exp.json @@ -81,6 +81,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -130,6 +133,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -188,6 +194,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json index d4bd78e02..c35b195c9 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_not_root.exp.json @@ -110,6 +110,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -159,6 +162,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -206,6 +212,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -264,6 +273,9 @@ "value": "z" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json index 8f7a7bf84..a59ff2068 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json @@ -124,6 +124,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -173,6 +176,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -251,6 +257,9 @@ "value": "But it's real. And if it's real it can be affected ... we may not be able" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json index d7bb50733..612e79cbe 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json @@ -124,6 +124,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -204,6 +207,9 @@ "value": "All we are given is possibilities -- to make ourselves one thing or another." }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -251,6 +257,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json index aa3ea871a..d99c73f5b 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_squared.exp.json @@ -121,6 +121,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -170,6 +173,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -217,6 +223,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -286,6 +295,9 @@ "value": "z" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/underscore_unresolved_obj.exp.json b/testdata/d2compiler/TestCompile/underscore_unresolved_obj.exp.json index 6c2c9ac2d..17b5f49ec 100644 --- a/testdata/d2compiler/TestCompile/underscore_unresolved_obj.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_unresolved_obj.exp.json @@ -81,6 +81,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -130,6 +133,9 @@ "value": "x" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -188,6 +194,9 @@ "value": "y" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/unescaped_id_cr.exp.json b/testdata/d2compiler/TestCompile/unescaped_id_cr.exp.json index 280044b62..1b00d60cc 100644 --- a/testdata/d2compiler/TestCompile/unescaped_id_cr.exp.json +++ b/testdata/d2compiler/TestCompile/unescaped_id_cr.exp.json @@ -41,6 +41,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -90,6 +93,9 @@ "value": "b\rb" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/url_link.exp.json b/testdata/d2compiler/TestCompile/url_link.exp.json index b0ebf8a9d..d45e56b1a 100644 --- a/testdata/d2compiler/TestCompile/url_link.exp.json +++ b/testdata/d2compiler/TestCompile/url_link.exp.json @@ -30,7 +30,7 @@ "nodes": [ { "map_key": { - "range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:2:7-1:26:31", + "range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:8:13-1:26:31", "key": { "range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:2:7-1:6:11", "path": [ @@ -80,6 +80,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -129,7 +132,9 @@ "value": "x" }, "style": {}, - "link": "https://google.com", + "link": { + "value": "https://google.com" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile/wrong_column_index.exp.json b/testdata/d2compiler/TestCompile/wrong_column_index.exp.json index 3bae4743f..34598fc17 100644 --- a/testdata/d2compiler/TestCompile/wrong_column_index.exp.json +++ b/testdata/d2compiler/TestCompile/wrong_column_index.exp.json @@ -702,6 +702,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -739,6 +742,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -991,6 +997,9 @@ "value": "Chinchillas" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" @@ -1157,6 +1166,9 @@ "value": "Chinchillas_Collectibles" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "sql_table" diff --git a/testdata/d2compiler/TestCompile2/boards/recursive.exp.json b/testdata/d2compiler/TestCompile2/boards/recursive.exp.json index 4496b0752..f42fd496d 100644 --- a/testdata/d2compiler/TestCompile2/boards/recursive.exp.json +++ b/testdata/d2compiler/TestCompile2/boards/recursive.exp.json @@ -307,6 +307,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -356,6 +359,9 @@ "value": "base" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -679,6 +685,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -728,6 +737,9 @@ "value": "santa" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -1051,6 +1063,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -1100,6 +1115,9 @@ "value": "clause" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -1423,6 +1441,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -1472,6 +1493,9 @@ "value": "reindeer" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -1795,6 +1819,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -1844,6 +1871,9 @@ "value": "montana" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" diff --git a/testdata/d2compiler/TestCompile2/boards/root.exp.json b/testdata/d2compiler/TestCompile2/boards/root.exp.json index 7efd58eac..db6d20393 100644 --- a/testdata/d2compiler/TestCompile2/boards/root.exp.json +++ b/testdata/d2compiler/TestCompile2/boards/root.exp.json @@ -174,6 +174,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -223,6 +226,9 @@ "value": "base" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -413,6 +419,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -462,6 +471,9 @@ "value": "santa" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle" @@ -652,6 +664,9 @@ "value": "" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "" @@ -701,6 +716,9 @@ "value": "clause" }, "style": {}, + "link": { + "value": "" + }, "near_key": null, "shape": { "value": "rectangle"