From 090d10e9cae3a7cd83f72453de9dabf09679aeac Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Tue, 11 Jul 2023 13:32:07 -0700 Subject: [PATCH] handle interpolation --- d2ast/d2ast.go | 22 ++ d2compiler/compile_test.go | 45 ++- d2ir/compile.go | 82 +++- .../TestCompile/array-classes.exp.json | 15 +- .../TestCompile/basic_icon.exp.json | 3 +- .../TestCompile/basic_sequence.exp.json | 3 +- .../TestCompile/basic_shape.exp.json | 3 +- .../TestCompile/class-shape-class.exp.json | 9 +- .../TestCompile/class_paren.exp.json | 9 +- .../TestCompile/class_style.exp.json | 6 +- .../d2compiler/TestCompile/classes.exp.json | 33 +- .../dimensions_on_containers.exp.json | 24 +- .../dimensions_on_nonimage.exp.json | 3 +- .../edge_arrowhead_fields.exp.json | 6 +- .../edge_arrowhead_primary.exp.json | 3 +- .../TestCompile/edge_chain.exp.json | 3 +- .../TestCompile/edge_chain_map.exp.json | 3 +- .../TestCompile/edge_column_index.exp.json | 18 +- .../TestCompile/edge_flat_arrowhead.exp.json | 3 +- .../edge_flat_label_arrowhead.exp.json | 3 +- .../TestCompile/edge_index.exp.json | 6 +- .../TestCompile/edge_index_map.exp.json | 3 +- .../TestCompile/edge_index_nested.exp.json | 6 +- .../edge_index_nested_cross_scope.exp.json | 6 +- .../d2compiler/TestCompile/edge_map.exp.json | 3 +- .../TestCompile/edge_map_arrowhead.exp.json | 3 +- .../TestCompile/edge_mixed_arrowhead.exp.json | 6 +- .../edge_non_shape_arrowhead.exp.json | 3 +- .../edge_semiflat_arrowhead.exp.json | 3 +- .../TestCompile/fill-pattern.exp.json | 3 +- .../icon-near-composite-together.exp.json | 3 +- .../TestCompile/image_style.exp.json | 9 +- .../label-near-composite-separate.exp.json | 6 +- .../label-near-composite-together.exp.json | 3 +- .../TestCompile/label-near-parent.exp.json | 3 +- .../TestCompile/link-board-mixed.exp.json | 18 +- .../TestCompile/missing-class.exp.json | 3 +- .../TestCompile/near_constant.exp.json | 3 +- .../TestCompile/nested-array-classes.exp.json | 3 +- .../TestCompile/nested_sql.exp.json | 9 +- .../d2compiler/TestCompile/path_link.exp.json | 3 +- .../TestCompile/reordered-classes.exp.json | 9 +- .../reserved_icon_near_style.exp.json | 12 +- .../TestCompile/root_direction.exp.json | 3 +- .../TestCompile/root_sequence.exp.json | 3 +- .../TestCompile/sequence-timestamp.exp.json | 3 +- .../TestCompile/sequence_container.exp.json | 3 +- .../TestCompile/sequence_container_2.exp.json | 3 +- .../sequence_grouped_note.exp.json | 3 +- .../TestCompile/sequence_scoping.exp.json | 3 +- .../TestCompile/set_direction.exp.json | 3 +- .../single_dimension_on_circle.exp.json | 3 +- .../TestCompile/sql-constraints.exp.json | 6 +- .../TestCompile/sql-regression.exp.json | 6 +- .../d2compiler/TestCompile/sql_paren.exp.json | 9 +- .../table_connection_attr.exp.json | 6 +- .../TestCompile/table_style.exp.json | 6 +- .../TestCompile/table_style_map.exp.json | 9 +- .../TestCompile/text-transform.exp.json | 12 +- .../underscore_edge_existing.exp.json | 6 +- .../underscore_edge_index.exp.json | 6 +- .../underscore_parent_preference_1.exp.json | 6 +- .../underscore_parent_preference_2.exp.json | 6 +- .../d2compiler/TestCompile/url_link.exp.json | 3 +- ..._and_not_url_tooltip_concurrently.exp.json | 6 +- .../url_link_non_url_tooltip_ok.exp.json | 6 +- .../TestCompile/url_tooltip.exp.json | 3 +- .../TestCompile/wrong_column_index.exp.json | 33 +- .../TestCompile2/boards/isFolderOnly.exp.json | 9 +- .../TestCompile2/vars/basic/combined.exp.json | 31 +- .../vars/basic/double-quoted.exp.json | 176 +++++++++ .../vars/basic/edge_label.exp.json | 20 +- .../TestCompile2/vars/basic/label.exp.json | 20 +- .../TestCompile2/vars/basic/nested.exp.json | 42 +- .../TestCompile2/vars/basic/number.exp.json | 20 +- .../vars/basic/single-quoted.exp.json | 173 +++++++++ .../TestCompile2/vars/basic/style.exp.json | 20 +- .../TestCompile2/vars/boards/layer.exp.json | 26 +- .../TestCompile2/vars/boards/overlay.exp.json | 101 ++--- .../TestCompile2/vars/boards/replace.exp.json | 366 +----------------- .../vars/boards/scenario.exp.json | 26 +- .../TestCompile2/vars/override/label.exp.json | 23 +- 82 files changed, 692 insertions(+), 939 deletions(-) create mode 100644 testdata/d2compiler/TestCompile2/vars/basic/double-quoted.exp.json create mode 100644 testdata/d2compiler/TestCompile2/vars/basic/single-quoted.exp.json diff --git a/d2ast/d2ast.go b/d2ast/d2ast.go index d49b1b268..25d325cf5 100644 --- a/d2ast/d2ast.go +++ b/d2ast/d2ast.go @@ -503,6 +503,17 @@ type UnquotedString struct { Value []InterpolationBox `json:"value"` } +func (s *UnquotedString) Coalesce() { + var b strings.Builder + for _, box := range s.Value { + if box.String == nil { + break + } + b.WriteString(*box.String) + } + s.SetString(b.String()) +} + func FlatUnquotedString(s string) *UnquotedString { return &UnquotedString{ Value: []InterpolationBox{{String: &s}}, @@ -514,6 +525,17 @@ type DoubleQuotedString struct { Value []InterpolationBox `json:"value"` } +func (s *DoubleQuotedString) Coalesce() { + var b strings.Builder + for _, box := range s.Value { + if box.String == nil { + break + } + b.WriteString(*box.String) + } + s.SetString(b.String()) +} + func FlatDoubleQuotedString(s string) *DoubleQuotedString { return &DoubleQuotedString{ Value: []InterpolationBox{{String: &s}}, diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 096cc1cac..22373fac5 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -3253,6 +3253,30 @@ hi: 1 ${x} 2 assert.Equal(t, "1 im a var 2", g.Objects[0].Label.Value) }, }, + { + name: "double-quoted", + run: func(t *testing.T) { + g := assertCompile(t, ` +vars: { + x: im a var +} +hi: "1 ${x} 2" +`, "") + assert.Equal(t, "1 im a var 2", g.Objects[0].Label.Value) + }, + }, + { + name: "single-quoted", + run: func(t *testing.T) { + g := assertCompile(t, ` +vars: { + x: im a var +} +hi: '1 ${x} 2' +`, "") + assert.Equal(t, "1 ${x} 2", g.Objects[0].Label.Value) + }, + }, { name: "edge label", run: func(t *testing.T) { @@ -3411,19 +3435,9 @@ scenarios: { x: ${x} } } -layers: { - l2: { - vars: { - x: im replaced x var - } - x: ${x} - } -} `, "") assert.Equal(t, 1, len(g.Scenarios[0].Objects)) assert.Equal(t, "im replaced x var", g.Scenarios[0].Objects[0].Label.Value) - assert.Equal(t, 1, len(g.Layers[0].Objects)) - assert.Equal(t, "im replaced x var", g.Layers[0].Objects[0].Label.Value) }, }, } @@ -3456,17 +3470,6 @@ vars: { x: hey } hi: ${z} -`, "d2/testdata/d2compiler/TestCompile2/vars/errors/missing.d2:5:1: could not resolve variable z") - }, - }, - { - name: "key", - run: func(t *testing.T) { - assertCompile(t, ` -vars: { - x: hey -} -${x} `, "d2/testdata/d2compiler/TestCompile2/vars/errors/missing.d2:5:1: could not resolve variable z") }, }, diff --git a/d2ir/compile.go b/d2ir/compile.go index b97362077..8e69091de 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -7,6 +7,7 @@ import ( "oss.terrastruct.com/d2/d2ast" "oss.terrastruct.com/d2/d2format" "oss.terrastruct.com/d2/d2parser" + "oss.terrastruct.com/util-go/go2" ) type compiler struct { @@ -96,7 +97,47 @@ func (c *compiler) overlayClasses(m *Map) { } } -func (c *compiler) resolveSubstitution(vars *Map, mk *d2ast.Key, substitution *d2ast.Substitution) d2ast.Scalar { +func (c *compiler) resolveSubstitutions(refctx *RefContext) { + varsMap := &Map{} + boardScope := refctx.ScopeMap + if NodeBoardKind(refctx.ScopeMap) == "" { + boardScope = ParentBoard(refctx.ScopeMap).Map() + } + vars := boardScope.GetField("vars") + if vars != nil { + varsMap = vars.Map() + } + + switch { + case refctx.Key.Value.Substitution != nil: + resolvedField := c.resolveSubstitution(varsMap, refctx.Key, refctx.Key.Value.Substitution) + if resolvedField != nil { + refctx.Key.Value = d2ast.MakeValueBox(resolvedField.Primary().Value) + } + case refctx.Key.Value.UnquotedString != nil: + for i, box := range refctx.Key.Value.UnquotedString.Value { + if box.Substitution != nil { + resolvedField := c.resolveSubstitution(varsMap, refctx.Key, box.Substitution) + if resolvedField != nil { + refctx.Key.Value.UnquotedString.Value[i].String = go2.Pointer(resolvedField.Primary().String()) + } + } + } + refctx.Key.Value.UnquotedString.Coalesce() + case refctx.Key.Value.DoubleQuotedString != nil: + for i, box := range refctx.Key.Value.DoubleQuotedString.Value { + if box.Substitution != nil { + resolvedField := c.resolveSubstitution(varsMap, refctx.Key, box.Substitution) + if resolvedField != nil { + refctx.Key.Value.DoubleQuotedString.Value[i].String = go2.Pointer(resolvedField.Primary().String()) + } + } + } + refctx.Key.Value.DoubleQuotedString.Coalesce() + } +} + +func (c *compiler) resolveSubstitution(vars *Map, mk *d2ast.Key, substitution *d2ast.Substitution) *Field { var resolved *Field for _, p := range substitution.Path { if vars == nil { @@ -115,7 +156,7 @@ func (c *compiler) resolveSubstitution(vars *Map, mk *d2ast.Key, substitution *d c.errorf(mk, "could not resolve variable %s", strings.Join(substitution.IDA(), ".")) } else { // TODO maps - return resolved.Primary().Value + return resolved } return nil } @@ -205,6 +246,7 @@ func (c *compiler) compileMap(dst *Map, ast, scopeAST *d2ast.Map) { func (c *compiler) compileKey(refctx *RefContext) { // resolve substitutions here + c.resolveSubstitutions(refctx) if len(refctx.Key.Edges) == 0 { c.compileField(refctx.ScopeMap, refctx.Key.Key, refctx) } else { @@ -308,15 +350,15 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext) c.overlayClasses(f.Map()) } } - } else if refctx.Key.Value.Substitution != nil { - vars := ParentBoard(f).Map().GetField("vars") - resolved := c.resolveSubstitution(vars.Map(), refctx.Key, refctx.Key.Value.Substitution) - if resolved != nil { - f.Primary_ = &Scalar{ - parent: f, - Value: resolved, - } - } + // } else if refctx.Key.Value.Substitution != nil { + // vars := ParentBoard(f).Map().GetField("vars") + // resolved := c.resolveSubstitution(vars.Map(), refctx.Key, refctx.Key.Value.Substitution) + // if resolved != nil { + // f.Primary_ = &Scalar{ + // parent: f, + // Value: resolved, + // } + // } } else if refctx.Key.Value.ScalarBox().Unbox() != nil { // If the link is a board, we need to transform it into an absolute path. if f.Name == "link" { @@ -496,15 +538,15 @@ func (c *compiler) compileEdges(refctx *RefContext) { } } c.compileMap(e.Map_, refctx.Key.Value.Map, refctx.ScopeAST) - } else if refctx.Key.Value.Substitution != nil { - vars := ParentBoard(e).Map().GetField("vars") - resolved := c.resolveSubstitution(vars.Map(), refctx.Key, refctx.Key.Value.Substitution) - if resolved != nil { - e.Primary_ = &Scalar{ - parent: e, - Value: resolved, - } - } + // } else if refctx.Key.Value.Substitution != nil { + // vars := ParentBoard(e).Map().GetField("vars") + // resolved := c.resolveSubstitution(vars.Map(), refctx.Key, refctx.Key.Value.Substitution) + // if resolved != nil { + // e.Primary_ = &Scalar{ + // parent: e, + // Value: resolved, + // } + // } } else if refctx.Key.Value.ScalarBox().Unbox() != nil { e.Primary_ = &Scalar{ parent: e, diff --git a/testdata/d2compiler/TestCompile/array-classes.exp.json b/testdata/d2compiler/TestCompile/array-classes.exp.json index 55f49e18a..dc757ba5e 100644 --- a/testdata/d2compiler/TestCompile/array-classes.exp.json +++ b/testdata/d2compiler/TestCompile/array-classes.exp.json @@ -76,7 +76,11 @@ "value": { "double_quoted_string": { "range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,2:11:39-2:13:41", - "value": null + "value": [ + { + "string": "" + } + ] } } } @@ -106,8 +110,7 @@ "range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,3:11:53-3:17:59", "value": [ { - "string": "circle", - "raw_string": "circle" + "string": "circle" } ] } @@ -150,8 +153,7 @@ "range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,4:16:76-4:22:82", "value": [ { - "string": "orange", - "raw_string": "orange" + "string": "orange" } ] } @@ -212,8 +214,7 @@ "range": "d2/testdata/d2compiler/TestCompile/array-classes.d2,7:11:108-7:17:114", "value": [ { - "string": "then", - "raw_string": "then" + "string": "then" } ] } diff --git a/testdata/d2compiler/TestCompile/basic_icon.exp.json b/testdata/d2compiler/TestCompile/basic_icon.exp.json index c4e7552f6..eab1c4dec 100644 --- a/testdata/d2compiler/TestCompile/basic_icon.exp.json +++ b/testdata/d2compiler/TestCompile/basic_icon.exp.json @@ -59,8 +59,7 @@ "range": "d2/testdata/d2compiler/TestCompile/basic_icon.d2,1:8:18-1:64:74", "value": [ { - "string": "https://icons.terrastruct.com/essentials/004-picture.svg", - "raw_string": "https://icons.terrastruct.com/essentials/004-picture.svg" + "string": "https://icons.terrastruct.com/essentials/004-picture.svg" } ] } diff --git a/testdata/d2compiler/TestCompile/basic_sequence.exp.json b/testdata/d2compiler/TestCompile/basic_sequence.exp.json index f5e4620d6..16840f3df 100644 --- a/testdata/d2compiler/TestCompile/basic_sequence.exp.json +++ b/testdata/d2compiler/TestCompile/basic_sequence.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/basic_sequence.d2,1:9:14-1:25:30", "value": [ { - "string": "sequence_diagram", - "raw_string": "sequence_diagram" + "string": "sequence_diagram" } ] } diff --git a/testdata/d2compiler/TestCompile/basic_shape.exp.json b/testdata/d2compiler/TestCompile/basic_shape.exp.json index ff306f1c4..d15fdb390 100644 --- a/testdata/d2compiler/TestCompile/basic_shape.exp.json +++ b/testdata/d2compiler/TestCompile/basic_shape.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/basic_shape.d2,2:9:15-2:15:21", "value": [ { - "string": "circle", - "raw_string": "circle" + "string": "circle" } ] } diff --git a/testdata/d2compiler/TestCompile/class-shape-class.exp.json b/testdata/d2compiler/TestCompile/class-shape-class.exp.json index 049d4ed34..0e3f13227 100644 --- a/testdata/d2compiler/TestCompile/class-shape-class.exp.json +++ b/testdata/d2compiler/TestCompile/class-shape-class.exp.json @@ -78,8 +78,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,2:11:38-2:16:43", "value": [ { - "string": "class", - "raw_string": "class" + "string": "class" } ] } @@ -145,8 +144,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,7:9:70-7:19:80", "value": [ { - "string": "classClass", - "raw_string": "classClass" + "string": "classClass" } ] } @@ -178,8 +176,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class-shape-class.d2,8:12:93-8:15:96", "value": [ { - "string": "int", - "raw_string": "int" + "string": "int" } ] } diff --git a/testdata/d2compiler/TestCompile/class_paren.exp.json b/testdata/d2compiler/TestCompile/class_paren.exp.json index c6b641edc..c6965fce8 100644 --- a/testdata/d2compiler/TestCompile/class_paren.exp.json +++ b/testdata/d2compiler/TestCompile/class_paren.exp.json @@ -64,8 +64,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class_paren.d2,1:9:28-1:14:33", "value": [ { - "string": "class", - "raw_string": "class" + "string": "class" } ] } @@ -120,8 +119,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class_paren.d2,4:13:60-4:19:66", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } @@ -153,8 +151,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class_paren.d2,5:8:75-5:12:79", "value": [ { - "string": "bool", - "raw_string": "bool" + "string": "bool" } ] } diff --git a/testdata/d2compiler/TestCompile/class_style.exp.json b/testdata/d2compiler/TestCompile/class_style.exp.json index f139da4f2..469bf1f8a 100644 --- a/testdata/d2compiler/TestCompile/class_style.exp.json +++ b/testdata/d2compiler/TestCompile/class_style.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class_style.d2,1:9:28-1:16:35", "value": [ { - "string": "class", - "raw_string": "class" + "string": "class" } ] } @@ -87,8 +86,7 @@ "range": "d2/testdata/d2compiler/TestCompile/class_style.d2,2:14:50-2:22:58", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } diff --git a/testdata/d2compiler/TestCompile/classes.exp.json b/testdata/d2compiler/TestCompile/classes.exp.json index ac50b12bd..35438dba3 100644 --- a/testdata/d2compiler/TestCompile/classes.exp.json +++ b/testdata/d2compiler/TestCompile/classes.exp.json @@ -76,7 +76,11 @@ "value": { "double_quoted_string": { "range": "d2/testdata/d2compiler/TestCompile/classes.d2,2:11:39-2:13:41", - "value": null + "value": [ + { + "string": "" + } + ] } } } @@ -106,8 +110,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,3:11:53-3:17:59", "value": [ { - "string": "circle", - "raw_string": "circle" + "string": "circle" } ] } @@ -150,8 +153,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,4:16:76-4:22:82", "value": [ { - "string": "orange", - "raw_string": "orange" + "string": "orange" } ] } @@ -212,8 +214,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,7:11:108-7:17:114", "value": [ { - "string": "then", - "raw_string": "then" + "string": "then" } ] } @@ -319,8 +320,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,11:17:164-11:28:175", "value": [ { - "string": "dragon_ball", - "raw_string": "dragon_ball" + "string": "dragon_ball" } ] } @@ -391,8 +391,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,12:20:198-12:31:209", "value": [ { - "string": "dragon_ball", - "raw_string": "dragon_ball" + "string": "dragon_ball" } ] } @@ -435,8 +434,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,12:45:223-12:48:226", "value": [ { - "string": "red", - "raw_string": "red" + "string": "red" } ] } @@ -497,8 +495,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,13:16:245-13:20:249", "value": [ { - "string": "**", - "raw_string": "**" + "string": "**" } ] } @@ -530,8 +527,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,13:29:258-13:40:269", "value": [ { - "string": "dragon_ball", - "raw_string": "dragon_ball" + "string": "dragon_ball" } ] } @@ -615,8 +611,7 @@ "range": "d2/testdata/d2compiler/TestCompile/classes.d2,15:26:299-15:30:303", "value": [ { - "string": "path", - "raw_string": "path" + "string": "path" } ] } diff --git a/testdata/d2compiler/TestCompile/dimensions_on_containers.exp.json b/testdata/d2compiler/TestCompile/dimensions_on_containers.exp.json index 6072848cd..7be798b03 100644 --- a/testdata/d2compiler/TestCompile/dimensions_on_containers.exp.json +++ b/testdata/d2compiler/TestCompile/dimensions_on_containers.exp.json @@ -78,8 +78,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,3:9:45-3:15:51", "value": [ { - "string": "circle", - "raw_string": "circle" + "string": "circle" } ] } @@ -164,8 +163,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,7:10:89-7:17:96", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } @@ -289,8 +287,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,13:9:163-13:16:170", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } @@ -404,8 +401,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,18:10:221-18:16:227", "value": [ { - "string": "circle", - "raw_string": "circle" + "string": "circle" } ] } @@ -500,8 +496,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,23:9:277-23:13:281", "value": [ { - "string": "oval", - "raw_string": "oval" + "string": "oval" } ] } @@ -615,8 +610,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,28:10:333-28:17:340", "value": [ { - "string": "hexagon", - "raw_string": "hexagon" + "string": "hexagon" } ] } @@ -740,8 +734,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,34:9:407-34:16:414", "value": [ { - "string": "hexagon", - "raw_string": "hexagon" + "string": "hexagon" } ] } @@ -855,8 +848,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_containers.d2,39:10:463-39:14:467", "value": [ { - "string": "oval", - "raw_string": "oval" + "string": "oval" } ] } diff --git a/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json b/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json index 2aad6eb2d..a182d32e9 100644 --- a/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json +++ b/testdata/d2compiler/TestCompile/dimensions_on_nonimage.exp.json @@ -59,8 +59,7 @@ "range": "d2/testdata/d2compiler/TestCompile/dimensions_on_nonimage.d2,1:9:19-1:16:26", "value": [ { - "string": "hexagon", - "raw_string": "hexagon" + "string": "hexagon" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json b/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json index 573bd41bb..0dc322a3f 100644 --- a/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json +++ b/testdata/d2compiler/TestCompile/edge_arrowhead_fields.exp.json @@ -111,8 +111,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_arrowhead_fields.d2,2:11:80-2:18:87", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } @@ -149,8 +148,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_arrowhead_fields.d2,4:20:112-4:24:116", "value": [ { - "string": "QOTD", - "raw_string": "QOTD" + "string": "QOTD" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_arrowhead_primary.exp.json b/testdata/d2compiler/TestCompile/edge_arrowhead_primary.exp.json index 43dbe6934..b9ffad1a6 100644 --- a/testdata/d2compiler/TestCompile/edge_arrowhead_primary.exp.json +++ b/testdata/d2compiler/TestCompile/edge_arrowhead_primary.exp.json @@ -77,8 +77,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_arrowhead_primary.d2,1:20:30-1:56:66", "value": [ { - "string": "Reisner's Rule of Conceptual Inertia", - "raw_string": "Reisner's Rule of Conceptual Inertia" + "string": "Reisner's Rule of Conceptual Inertia" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_chain.exp.json b/testdata/d2compiler/TestCompile/edge_chain.exp.json index fc3cb532e..683290ef1 100644 --- a/testdata/d2compiler/TestCompile/edge_chain.exp.json +++ b/testdata/d2compiler/TestCompile/edge_chain.exp.json @@ -90,8 +90,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_chain.d2,1:13:14-1:55:56", "value": [ { - "string": "The kids will love our inflatable slides", - "raw_string": "The kids will love our inflatable slides" + "string": "The kids will love our inflatable slides" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_chain_map.exp.json b/testdata/d2compiler/TestCompile/edge_chain_map.exp.json index 7b58cb7bd..f6b01e3b1 100644 --- a/testdata/d2compiler/TestCompile/edge_chain_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_chain_map.exp.json @@ -114,8 +114,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_chain_map.d2,2:9:25-2:88:104", "value": [ { - "string": "Space: the final frontier. These are the voyages of the starship Enterprise.", - "raw_string": "Space: the final frontier. These are the voyages of the starship Enterprise." + "string": "Space: the final frontier. These are the voyages of the starship Enterprise." } ] } diff --git a/testdata/d2compiler/TestCompile/edge_column_index.exp.json b/testdata/d2compiler/TestCompile/edge_column_index.exp.json index a1f43e986..c0b4d7be4 100644 --- a/testdata/d2compiler/TestCompile/edge_column_index.exp.json +++ b/testdata/d2compiler/TestCompile/edge_column_index.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_column_index.d2,1:8:15-1:17:24", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -87,8 +86,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_column_index.d2,2:5:30-2:8:33", "value": [ { - "string": "int", - "raw_string": "int" + "string": "int" } ] } @@ -120,8 +118,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_column_index.d2,3:9:43-3:12:46", "value": [ { - "string": "int", - "raw_string": "int" + "string": "int" } ] } @@ -182,8 +179,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_column_index.d2,7:8:65-7:17:74", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -215,8 +211,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_column_index.d2,8:5:80-8:8:83", "value": [ { - "string": "int", - "raw_string": "int" + "string": "int" } ] } @@ -248,8 +243,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_column_index.d2,9:7:91-9:13:97", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json index 50be77f89..5d842efab 100644 --- a/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_flat_arrowhead.exp.json @@ -131,8 +131,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_flat_arrowhead.d2,1:36:43-1:43:50", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json index bccfb9129..052c0ff53 100644 --- a/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.exp.json @@ -94,8 +94,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_flat_label_arrowhead.d2,2:26:48-2:28:50", "value": [ { - "string": "yo", - "raw_string": "yo" + "string": "yo" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_index.exp.json b/testdata/d2compiler/TestCompile/edge_index.exp.json index dec38ad77..95a7d7d14 100644 --- a/testdata/d2compiler/TestCompile/edge_index.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index.exp.json @@ -53,8 +53,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_index.d2,1:8:9-1:11:12", "value": [ { - "string": "one", - "raw_string": "one" + "string": "one" } ] } @@ -114,8 +113,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_index.d2,2:13:26-2:16:29", "value": [ { - "string": "two", - "raw_string": "two" + "string": "two" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_index_map.exp.json b/testdata/d2compiler/TestCompile/edge_index_map.exp.json index 14c91274e..d97ce029d 100644 --- a/testdata/d2compiler/TestCompile/edge_index_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_map.exp.json @@ -128,8 +128,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_index_map.d2,3:9:32-3:88:111", "value": [ { - "string": "Space: the final frontier. These are the voyages of the starship Enterprise.", - "raw_string": "Space: the final frontier. These are the voyages of the starship Enterprise." + "string": "Space: the final frontier. These are the voyages of the starship Enterprise." } ] } diff --git a/testdata/d2compiler/TestCompile/edge_index_nested.exp.json b/testdata/d2compiler/TestCompile/edge_index_nested.exp.json index 6ebba4d34..340db8107 100644 --- a/testdata/d2compiler/TestCompile/edge_index_nested.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_nested.exp.json @@ -77,8 +77,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_index_nested.d2,2:9:15-2:12:18", "value": [ { - "string": "one", - "raw_string": "one" + "string": "one" } ] } @@ -138,8 +137,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_index_nested.d2,3:14:33-3:17:36", "value": [ { - "string": "two", - "raw_string": "two" + "string": "two" } ] } 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 084167741..a2d139a60 100644 --- a/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json +++ b/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.exp.json @@ -77,8 +77,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.d2,2:9:15-2:12:18", "value": [ { - "string": "one", - "raw_string": "one" + "string": "one" } ] } @@ -159,8 +158,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_index_nested_cross_scope.d2,4:15:36-4:18:39", "value": [ { - "string": "two", - "raw_string": "two" + "string": "two" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_map.exp.json b/testdata/d2compiler/TestCompile/edge_map.exp.json index 4e4652c77..4c010a354 100644 --- a/testdata/d2compiler/TestCompile/edge_map.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map.exp.json @@ -77,8 +77,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_map.d2,2:9:20-2:88:99", "value": [ { - "string": "Space: the final frontier. These are the voyages of the starship Enterprise.", - "raw_string": "Space: the final frontier. These are the voyages of the starship Enterprise." + "string": "Space: the final frontier. These are the voyages of the starship Enterprise." } ] } diff --git a/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json index 9874c0c27..3e1995bad 100644 --- a/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_map_arrowhead.exp.json @@ -101,8 +101,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_map_arrowhead.d2,2:11:43-2:18:50", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json index c00936b2d..617802255 100644 --- a/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.exp.json @@ -88,8 +88,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.d2,1:26:36-1:33:43", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } @@ -194,8 +193,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_mixed_arrowhead.d2,4:9:87-4:16:94", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json index 6f5721e7c..08e3122d8 100644 --- a/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.exp.json @@ -88,8 +88,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_non_shape_arrowhead.d2,0:34:34-0:42:42", "value": [ { - "string": "triangle", - "raw_string": "triangle" + "string": "triangle" } ] } diff --git a/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json b/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json index 18c537b79..51c1ca72f 100644 --- a/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json +++ b/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.exp.json @@ -144,8 +144,7 @@ "range": "d2/testdata/d2compiler/TestCompile/edge_semiflat_arrowhead.d2,2:9:48-2:16:55", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } diff --git a/testdata/d2compiler/TestCompile/fill-pattern.exp.json b/testdata/d2compiler/TestCompile/fill-pattern.exp.json index fcdeecfc7..24e740e1e 100644 --- a/testdata/d2compiler/TestCompile/fill-pattern.exp.json +++ b/testdata/d2compiler/TestCompile/fill-pattern.exp.json @@ -78,8 +78,7 @@ "range": "d2/testdata/d2compiler/TestCompile/fill-pattern.d2,2:18:33-2:22:37", "value": [ { - "string": "dots", - "raw_string": "dots" + "string": "dots" } ] } diff --git a/testdata/d2compiler/TestCompile/icon-near-composite-together.exp.json b/testdata/d2compiler/TestCompile/icon-near-composite-together.exp.json index 1d0b6974e..632db4569 100644 --- a/testdata/d2compiler/TestCompile/icon-near-composite-together.exp.json +++ b/testdata/d2compiler/TestCompile/icon-near-composite-together.exp.json @@ -88,8 +88,7 @@ "range": "d2/testdata/d2compiler/TestCompile/icon-near-composite-together.d2,2:8:41-2:24:57", "value": [ { - "string": "outside-top-left", - "raw_string": "outside-top-left" + "string": "outside-top-left" } ] } diff --git a/testdata/d2compiler/TestCompile/image_style.exp.json b/testdata/d2compiler/TestCompile/image_style.exp.json index 0f22863e9..183ccb980 100644 --- a/testdata/d2compiler/TestCompile/image_style.exp.json +++ b/testdata/d2compiler/TestCompile/image_style.exp.json @@ -59,8 +59,7 @@ "range": "d2/testdata/d2compiler/TestCompile/image_style.d2,1:8:18-1:64:74", "value": [ { - "string": "https://icons.terrastruct.com/essentials/004-picture.svg", - "raw_string": "https://icons.terrastruct.com/essentials/004-picture.svg" + "string": "https://icons.terrastruct.com/essentials/004-picture.svg" } ] } @@ -92,8 +91,7 @@ "range": "d2/testdata/d2compiler/TestCompile/image_style.d2,2:9:84-2:14:89", "value": [ { - "string": "image", - "raw_string": "image" + "string": "image" } ] } @@ -136,8 +134,7 @@ "range": "d2/testdata/d2compiler/TestCompile/image_style.d2,3:16:106-3:25:115", "value": [ { - "string": "#0D32B2", - "raw_string": "#0D32B2" + "string": "#0D32B2" } ] } diff --git a/testdata/d2compiler/TestCompile/label-near-composite-separate.exp.json b/testdata/d2compiler/TestCompile/label-near-composite-separate.exp.json index b73200e7a..22ecfc551 100644 --- a/testdata/d2compiler/TestCompile/label-near-composite-separate.exp.json +++ b/testdata/d2compiler/TestCompile/label-near-composite-separate.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/label-near-composite-separate.d2,1:8:15-1:13:20", "value": [ { - "string": "sushi", - "raw_string": "sushi" + "string": "sushi" } ] } @@ -98,8 +97,7 @@ "range": "d2/testdata/d2compiler/TestCompile/label-near-composite-separate.d2,2:13:34-2:29:50", "value": [ { - "string": "outside-top-left", - "raw_string": "outside-top-left" + "string": "outside-top-left" } ] } diff --git a/testdata/d2compiler/TestCompile/label-near-composite-together.exp.json b/testdata/d2compiler/TestCompile/label-near-composite-together.exp.json index ee68c9863..bedc9a9a8 100644 --- a/testdata/d2compiler/TestCompile/label-near-composite-together.exp.json +++ b/testdata/d2compiler/TestCompile/label-near-composite-together.exp.json @@ -88,8 +88,7 @@ "range": "d2/testdata/d2compiler/TestCompile/label-near-composite-together.d2,2:8:32-2:24:48", "value": [ { - "string": "outside-top-left", - "raw_string": "outside-top-left" + "string": "outside-top-left" } ] } diff --git a/testdata/d2compiler/TestCompile/label-near-parent.exp.json b/testdata/d2compiler/TestCompile/label-near-parent.exp.json index 192949f56..261465cf6 100644 --- a/testdata/d2compiler/TestCompile/label-near-parent.exp.json +++ b/testdata/d2compiler/TestCompile/label-near-parent.exp.json @@ -75,8 +75,7 @@ "range": "d2/testdata/d2compiler/TestCompile/label-near-parent.d2,1:13:26-1:29:42", "value": [ { - "string": "outside-top-left", - "raw_string": "outside-top-left" + "string": "outside-top-left" } ] } diff --git a/testdata/d2compiler/TestCompile/link-board-mixed.exp.json b/testdata/d2compiler/TestCompile/link-board-mixed.exp.json index 974fc5fbc..e0120bcc5 100644 --- a/testdata/d2compiler/TestCompile/link-board-mixed.exp.json +++ b/testdata/d2compiler/TestCompile/link-board-mixed.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:10:10-0:30:30", "value": [ { - "string": "How does the cat go?", - "raw_string": "How does the cat go?" + "string": "How does the cat go?" } ] } @@ -177,8 +176,7 @@ "range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,5:26:103-5:30:107", "value": [ { - "string": "goes", - "raw_string": "goes" + "string": "goes" } ] } @@ -290,8 +288,7 @@ "range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:25:164-11:30:169", "value": [ { - "string": "green", - "raw_string": "green" + "string": "green" } ] } @@ -511,8 +508,7 @@ "range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,5:26:103-5:30:107", "value": [ { - "string": "goes", - "raw_string": "goes" + "string": "goes" } ] } @@ -701,8 +697,7 @@ "range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:10:10-0:30:30", "value": [ { - "string": "How does the cat go?", - "raw_string": "How does the cat go?" + "string": "How does the cat go?" } ] } @@ -788,8 +783,7 @@ "range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:25:164-11:30:169", "value": [ { - "string": "green", - "raw_string": "green" + "string": "green" } ] } diff --git a/testdata/d2compiler/TestCompile/missing-class.exp.json b/testdata/d2compiler/TestCompile/missing-class.exp.json index 1aa7a9673..25f2adca7 100644 --- a/testdata/d2compiler/TestCompile/missing-class.exp.json +++ b/testdata/d2compiler/TestCompile/missing-class.exp.json @@ -41,8 +41,7 @@ "range": "d2/testdata/d2compiler/TestCompile/missing-class.d2,0:9:9-0:11:11", "value": [ { - "string": "yo", - "raw_string": "yo" + "string": "yo" } ] } diff --git a/testdata/d2compiler/TestCompile/near_constant.exp.json b/testdata/d2compiler/TestCompile/near_constant.exp.json index 6139e09c5..d6f5751d1 100644 --- a/testdata/d2compiler/TestCompile/near_constant.exp.json +++ b/testdata/d2compiler/TestCompile/near_constant.exp.json @@ -41,8 +41,7 @@ "range": "d2/testdata/d2compiler/TestCompile/near_constant.d2,0:8:8-0:18:18", "value": [ { - "string": "top-center", - "raw_string": "top-center" + "string": "top-center" } ] } diff --git a/testdata/d2compiler/TestCompile/nested-array-classes.exp.json b/testdata/d2compiler/TestCompile/nested-array-classes.exp.json index a897f1678..0ba0aac3f 100644 --- a/testdata/d2compiler/TestCompile/nested-array-classes.exp.json +++ b/testdata/d2compiler/TestCompile/nested-array-classes.exp.json @@ -158,8 +158,7 @@ "range": "d2/testdata/d2compiler/TestCompile/nested-array-classes.d2,5:26:101-5:31:106", "value": [ { - "string": "arrow", - "raw_string": "arrow" + "string": "arrow" } ] } diff --git a/testdata/d2compiler/TestCompile/nested_sql.exp.json b/testdata/d2compiler/TestCompile/nested_sql.exp.json index 1781b2ac6..6c15ddb77 100644 --- a/testdata/d2compiler/TestCompile/nested_sql.exp.json +++ b/testdata/d2compiler/TestCompile/nested_sql.exp.json @@ -78,8 +78,7 @@ "range": "d2/testdata/d2compiler/TestCompile/nested_sql.d2,2:11:31-2:20:40", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -111,8 +110,7 @@ "range": "d2/testdata/d2compiler/TestCompile/nested_sql.d2,4:15:57-4:21:63", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } @@ -144,8 +142,7 @@ "range": "d2/testdata/d2compiler/TestCompile/nested_sql.d2,5:10:74-5:14:78", "value": [ { - "string": "bool", - "raw_string": "bool" + "string": "bool" } ] } diff --git a/testdata/d2compiler/TestCompile/path_link.exp.json b/testdata/d2compiler/TestCompile/path_link.exp.json index af370962e..c2daa0039 100644 --- a/testdata/d2compiler/TestCompile/path_link.exp.json +++ b/testdata/d2compiler/TestCompile/path_link.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:8:13-1:39:44", "value": [ { - "string": "Overview.Untitled board 7.zzzzz", - "raw_string": "Overview.Untitled board 7.zzzzz" + "string": "Overview.Untitled board 7.zzzzz" } ] } diff --git a/testdata/d2compiler/TestCompile/reordered-classes.exp.json b/testdata/d2compiler/TestCompile/reordered-classes.exp.json index 07280d1c2..0e9844908 100644 --- a/testdata/d2compiler/TestCompile/reordered-classes.exp.json +++ b/testdata/d2compiler/TestCompile/reordered-classes.exp.json @@ -78,8 +78,7 @@ "range": "d2/testdata/d2compiler/TestCompile/reordered-classes.d2,2:11:29-2:17:35", "value": [ { - "string": "circle", - "raw_string": "circle" + "string": "circle" } ] } @@ -132,8 +131,7 @@ "range": "d2/testdata/d2compiler/TestCompile/reordered-classes.d2,5:9:51-5:10:52", "value": [ { - "string": "x", - "raw_string": "x" + "string": "x" } ] } @@ -187,8 +185,7 @@ "range": "d2/testdata/d2compiler/TestCompile/reordered-classes.d2,6:17:70-6:24:77", "value": [ { - "string": "diamond", - "raw_string": "diamond" + "string": "diamond" } ] } diff --git a/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json b/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json index d037b9da4..e2cc05144 100644 --- a/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json +++ b/testdata/d2compiler/TestCompile/reserved_icon_near_style.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/reserved_icon_near_style.d2,1:8:13-1:14:19", "value": [ { - "string": "orange", - "raw_string": "orange" + "string": "orange" } ] } @@ -138,8 +137,7 @@ "range": "d2/testdata/d2compiler/TestCompile/reserved_icon_near_style.d2,3:16:57-3:19:60", "value": [ { - "string": "red", - "raw_string": "red" + "string": "red" } ] } @@ -182,8 +180,7 @@ "range": "d2/testdata/d2compiler/TestCompile/reserved_icon_near_style.d2,4:13:74-4:18:79", "value": [ { - "string": "green", - "raw_string": "green" + "string": "green" } ] } @@ -231,8 +228,7 @@ "range": "d2/testdata/d2compiler/TestCompile/reserved_icon_near_style.d2,6:8:90-6:9:91", "value": [ { - "string": "y", - "raw_string": "y" + "string": "y" } ] } diff --git a/testdata/d2compiler/TestCompile/root_direction.exp.json b/testdata/d2compiler/TestCompile/root_direction.exp.json index 98ba30eda..8fdf89c77 100644 --- a/testdata/d2compiler/TestCompile/root_direction.exp.json +++ b/testdata/d2compiler/TestCompile/root_direction.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/root_direction.d2,0:11:11-0:16:16", "value": [ { - "string": "right", - "raw_string": "right" + "string": "right" } ] } diff --git a/testdata/d2compiler/TestCompile/root_sequence.exp.json b/testdata/d2compiler/TestCompile/root_sequence.exp.json index 353ce9a61..510f8fe47 100644 --- a/testdata/d2compiler/TestCompile/root_sequence.exp.json +++ b/testdata/d2compiler/TestCompile/root_sequence.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/root_sequence.d2,0:7:7-0:23:23", "value": [ { - "string": "sequence_diagram", - "raw_string": "sequence_diagram" + "string": "sequence_diagram" } ] } diff --git a/testdata/d2compiler/TestCompile/sequence-timestamp.exp.json b/testdata/d2compiler/TestCompile/sequence-timestamp.exp.json index 4c90eaac0..8248fadb1 100644 --- a/testdata/d2compiler/TestCompile/sequence-timestamp.exp.json +++ b/testdata/d2compiler/TestCompile/sequence-timestamp.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sequence-timestamp.d2,0:7:7-0:23:23", "value": [ { - "string": "sequence_diagram", - "raw_string": "sequence_diagram" + "string": "sequence_diagram" } ] } diff --git a/testdata/d2compiler/TestCompile/sequence_container.exp.json b/testdata/d2compiler/TestCompile/sequence_container.exp.json index 5dd16ad44..170abd9c8 100644 --- a/testdata/d2compiler/TestCompile/sequence_container.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_container.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sequence_container.d2,0:7:7-0:23:23", "value": [ { - "string": "sequence_diagram", - "raw_string": "sequence_diagram" + "string": "sequence_diagram" } ] } diff --git a/testdata/d2compiler/TestCompile/sequence_container_2.exp.json b/testdata/d2compiler/TestCompile/sequence_container_2.exp.json index 503423b6c..dc7b3eb12 100644 --- a/testdata/d2compiler/TestCompile/sequence_container_2.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_container_2.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sequence_container_2.d2,0:7:7-0:23:23", "value": [ { - "string": "sequence_diagram", - "raw_string": "sequence_diagram" + "string": "sequence_diagram" } ] } diff --git a/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json b/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json index 1958d8227..459a76786 100644 --- a/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_grouped_note.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sequence_grouped_note.d2,0:7:7-0:23:23", "value": [ { - "string": "sequence_diagram", - "raw_string": "sequence_diagram" + "string": "sequence_diagram" } ] } diff --git a/testdata/d2compiler/TestCompile/sequence_scoping.exp.json b/testdata/d2compiler/TestCompile/sequence_scoping.exp.json index 0870aa4c1..a46a3fa31 100644 --- a/testdata/d2compiler/TestCompile/sequence_scoping.exp.json +++ b/testdata/d2compiler/TestCompile/sequence_scoping.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sequence_scoping.d2,1:9:14-1:25:30", "value": [ { - "string": "sequence_diagram", - "raw_string": "sequence_diagram" + "string": "sequence_diagram" } ] } diff --git a/testdata/d2compiler/TestCompile/set_direction.exp.json b/testdata/d2compiler/TestCompile/set_direction.exp.json index b59d6d0da..92d4166c1 100644 --- a/testdata/d2compiler/TestCompile/set_direction.exp.json +++ b/testdata/d2compiler/TestCompile/set_direction.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/set_direction.d2,1:13:18-1:17:22", "value": [ { - "string": "left", - "raw_string": "left" + "string": "left" } ] } diff --git a/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json b/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json index 3cf517caa..afba4f2c6 100644 --- a/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json +++ b/testdata/d2compiler/TestCompile/single_dimension_on_circle.exp.json @@ -59,8 +59,7 @@ "range": "d2/testdata/d2compiler/TestCompile/single_dimension_on_circle.d2,1:8:18-1:14:24", "value": [ { - "string": "circle", - "raw_string": "circle" + "string": "circle" } ] } diff --git a/testdata/d2compiler/TestCompile/sql-constraints.exp.json b/testdata/d2compiler/TestCompile/sql-constraints.exp.json index db24296fa..a74178a5e 100644 --- a/testdata/d2compiler/TestCompile/sql-constraints.exp.json +++ b/testdata/d2compiler/TestCompile/sql-constraints.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sql-constraints.d2,1:9:14-1:18:23", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -121,8 +120,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sql-constraints.d2,2:22:46-2:33:57", "value": [ { - "string": "primary_key", - "raw_string": "primary_key" + "string": "primary_key" } ] } diff --git a/testdata/d2compiler/TestCompile/sql-regression.exp.json b/testdata/d2compiler/TestCompile/sql-regression.exp.json index 64b5d46e5..47cfcf60c 100644 --- a/testdata/d2compiler/TestCompile/sql-regression.exp.json +++ b/testdata/d2compiler/TestCompile/sql-regression.exp.json @@ -78,8 +78,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sql-regression.d2,2:10:26-2:22:38", "value": [ { - "string": "lemonchiffon", - "raw_string": "lemonchiffon" + "string": "lemonchiffon" } ] } @@ -140,8 +139,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sql-regression.d2,5:11:61-5:20:70", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } diff --git a/testdata/d2compiler/TestCompile/sql_paren.exp.json b/testdata/d2compiler/TestCompile/sql_paren.exp.json index 8064ff8ed..4bc3e381e 100644 --- a/testdata/d2compiler/TestCompile/sql_paren.exp.json +++ b/testdata/d2compiler/TestCompile/sql_paren.exp.json @@ -64,8 +64,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sql_paren.d2,1:9:28-1:18:37", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -97,8 +96,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sql_paren.d2,3:13:52-3:19:58", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } @@ -130,8 +128,7 @@ "range": "d2/testdata/d2compiler/TestCompile/sql_paren.d2,4:8:67-4:12:71", "value": [ { - "string": "bool", - "raw_string": "bool" + "string": "bool" } ] } diff --git a/testdata/d2compiler/TestCompile/table_connection_attr.exp.json b/testdata/d2compiler/TestCompile/table_connection_attr.exp.json index 9012bd927..8d0548dea 100644 --- a/testdata/d2compiler/TestCompile/table_connection_attr.exp.json +++ b/testdata/d2compiler/TestCompile/table_connection_attr.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/table_connection_attr.d2,1:9:14-1:18:23", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -139,8 +138,7 @@ "range": "d2/testdata/d2compiler/TestCompile/table_connection_attr.d2,5:9:44-5:18:53", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } diff --git a/testdata/d2compiler/TestCompile/table_style.exp.json b/testdata/d2compiler/TestCompile/table_style.exp.json index b68772eff..782284d04 100644 --- a/testdata/d2compiler/TestCompile/table_style.exp.json +++ b/testdata/d2compiler/TestCompile/table_style.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/table_style.d2,1:9:28-1:18:37", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -87,8 +86,7 @@ "range": "d2/testdata/d2compiler/TestCompile/table_style.d2,2:13:51-2:19:57", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } diff --git a/testdata/d2compiler/TestCompile/table_style_map.exp.json b/testdata/d2compiler/TestCompile/table_style_map.exp.json index bd065d54f..a2e8f3ff5 100644 --- a/testdata/d2compiler/TestCompile/table_style_map.exp.json +++ b/testdata/d2compiler/TestCompile/table_style_map.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/table_style_map.d2,1:9:28-1:18:37", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -87,8 +86,7 @@ "range": "d2/testdata/d2compiler/TestCompile/table_style_map.d2,2:13:51-2:19:57", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } @@ -173,8 +171,7 @@ "range": "d2/testdata/d2compiler/TestCompile/table_style_map.d2,5:16:102-5:20:106", "value": [ { - "string": "blue", - "raw_string": "blue" + "string": "blue" } ] } diff --git a/testdata/d2compiler/TestCompile/text-transform.exp.json b/testdata/d2compiler/TestCompile/text-transform.exp.json index 6d32e0f75..e8e1fd4a1 100644 --- a/testdata/d2compiler/TestCompile/text-transform.exp.json +++ b/testdata/d2compiler/TestCompile/text-transform.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/text-transform.d2,0:11:11-0:16:16", "value": [ { - "string": "right", - "raw_string": "right" + "string": "right" } ] } @@ -144,8 +143,7 @@ "range": "d2/testdata/d2compiler/TestCompile/text-transform.d2,3:20:61-3:30:71", "value": [ { - "string": "capitalize", - "raw_string": "capitalize" + "string": "capitalize" } ] } @@ -209,8 +207,7 @@ "range": "d2/testdata/d2compiler/TestCompile/text-transform.d2,6:24:102-6:33:111", "value": [ { - "string": "uppercase", - "raw_string": "uppercase" + "string": "uppercase" } ] } @@ -264,8 +261,7 @@ "range": "d2/testdata/d2compiler/TestCompile/text-transform.d2,7:24:136-7:33:145", "value": [ { - "string": "lowercase", - "raw_string": "lowercase" + "string": "lowercase" } ] } diff --git a/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json index 7b44d6ac8..6d2eaca67 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_existing.exp.json @@ -53,8 +53,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_edge_existing.d2,1:8:9-1:77:78", "value": [ { - "string": "Can you imagine how life could be improved if we could do away with", - "raw_string": "Can you imagine how life could be improved if we could do away with" + "string": "Can you imagine how life could be improved if we could do away with" } ] } @@ -155,8 +154,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_edge_existing.d2,3:13:97-3:80:164", "value": [ { - "string": "Well, it's garish, ugly, and derelicts have used it for a toilet.", - "raw_string": "Well, it's garish, ugly, and derelicts have used it for a toilet." + "string": "Well, it's garish, ugly, and derelicts have used it for a toilet." } ] } diff --git a/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json b/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json index 25aa72494..b88843238 100644 --- a/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_edge_index.exp.json @@ -53,8 +53,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_edge_index.d2,1:8:9-1:77:78", "value": [ { - "string": "Can you imagine how life could be improved if we could do away with", - "raw_string": "Can you imagine how life could be improved if we could do away with" + "string": "Can you imagine how life could be improved if we could do away with" } ] } @@ -160,8 +159,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_edge_index.d2,3:18:102-3:85:169", "value": [ { - "string": "Well, it's garish, ugly, and derelicts have used it for a toilet.", - "raw_string": "Well, it's garish, ugly, and derelicts have used it for a toilet." + "string": "Well, it's garish, ugly, and derelicts have used it for a toilet." } ] } diff --git a/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json index 8e1ecb3f2..ea91c3114 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_preference_1.exp.json @@ -65,8 +65,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_parent_preference_1.d2,2:6:12-2:84:90", "value": [ { - "string": "All we are given is possibilities -- to make ourselves one thing or another.", - "raw_string": "All we are given is possibilities -- to make ourselves one thing or another." + "string": "All we are given is possibilities -- to make ourselves one thing or another." } ] } @@ -103,8 +102,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_parent_preference_1.d2,4:3:96-4:80:173", "value": [ { - "string": "But it's real. And if it's real it can be affected ... we may not be able", - "raw_string": "But it's real. And if it's real it can be affected ... we may not be able" + "string": "But it's real. And if it's real it can be affected ... we may not be able" } ] } diff --git a/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json b/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json index e8850d2a2..b241f3064 100644 --- a/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json +++ b/testdata/d2compiler/TestCompile/underscore_parent_preference_2.exp.json @@ -30,8 +30,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_parent_preference_2.d2,1:3:4-1:80:81", "value": [ { - "string": "But it's real. And if it's real it can be affected ... we may not be able", - "raw_string": "But it's real. And if it's real it can be affected ... we may not be able" + "string": "But it's real. And if it's real it can be affected ... we may not be able" } ] } @@ -98,8 +97,7 @@ "range": "d2/testdata/d2compiler/TestCompile/underscore_parent_preference_2.d2,3:6:93-3:84:171", "value": [ { - "string": "All we are given is possibilities -- to make ourselves one thing or another.", - "raw_string": "All we are given is possibilities -- to make ourselves one thing or another." + "string": "All we are given is possibilities -- to make ourselves one thing or another." } ] } diff --git a/testdata/d2compiler/TestCompile/url_link.exp.json b/testdata/d2compiler/TestCompile/url_link.exp.json index 0ee2c0378..ec370207a 100644 --- a/testdata/d2compiler/TestCompile/url_link.exp.json +++ b/testdata/d2compiler/TestCompile/url_link.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:8:13-1:26:31", "value": [ { - "string": "https://google.com", - "raw_string": "https://google.com" + "string": "https://google.com" } ] } diff --git a/testdata/d2compiler/TestCompile/url_link_and_not_url_tooltip_concurrently.exp.json b/testdata/d2compiler/TestCompile/url_link_and_not_url_tooltip_concurrently.exp.json index 4fc6b9851..c581bc47f 100644 --- a/testdata/d2compiler/TestCompile/url_link_and_not_url_tooltip_concurrently.exp.json +++ b/testdata/d2compiler/TestCompile/url_link_and_not_url_tooltip_concurrently.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/url_link_and_not_url_tooltip_concurrently.d2,0:10:10-0:28:28", "value": [ { - "string": "https://google.com", - "raw_string": "https://google.com" + "string": "https://google.com" } ] } @@ -87,8 +86,7 @@ "range": "d2/testdata/d2compiler/TestCompile/url_link_and_not_url_tooltip_concurrently.d2,0:39:39-0:50:50", "value": [ { - "string": "hello world", - "raw_string": "hello world" + "string": "hello world" } ] } diff --git a/testdata/d2compiler/TestCompile/url_link_non_url_tooltip_ok.exp.json b/testdata/d2compiler/TestCompile/url_link_non_url_tooltip_ok.exp.json index 55017b2a1..201fb038a 100644 --- a/testdata/d2compiler/TestCompile/url_link_non_url_tooltip_ok.exp.json +++ b/testdata/d2compiler/TestCompile/url_link_non_url_tooltip_ok.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/url_link_non_url_tooltip_ok.d2,0:10:10-0:32:32", "value": [ { - "string": "https://not-google.com", - "raw_string": "https://not-google.com" + "string": "https://not-google.com" } ] } @@ -87,8 +86,7 @@ "range": "d2/testdata/d2compiler/TestCompile/url_link_non_url_tooltip_ok.d2,0:43:43-0:92:92", "value": [ { - "string": "note: url.ParseRequestURI might see this as a URL", - "raw_string": "note: url.ParseRequestURI might see this as a URL" + "string": "note: url.ParseRequestURI might see this as a URL" } ] } diff --git a/testdata/d2compiler/TestCompile/url_tooltip.exp.json b/testdata/d2compiler/TestCompile/url_tooltip.exp.json index 5191349ed..302556ce6 100644 --- a/testdata/d2compiler/TestCompile/url_tooltip.exp.json +++ b/testdata/d2compiler/TestCompile/url_tooltip.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/url_tooltip.d2,0:13:13-0:31:31", "value": [ { - "string": "https://google.com", - "raw_string": "https://google.com" + "string": "https://google.com" } ] } diff --git a/testdata/d2compiler/TestCompile/wrong_column_index.exp.json b/testdata/d2compiler/TestCompile/wrong_column_index.exp.json index 555ed3efc..17739cdd2 100644 --- a/testdata/d2compiler/TestCompile/wrong_column_index.exp.json +++ b/testdata/d2compiler/TestCompile/wrong_column_index.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,1:9:24-1:18:33", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -121,8 +120,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:23:57-2:34:68", "value": [ { - "string": "primary_key", - "raw_string": "primary_key" + "string": "primary_key" } ] } @@ -159,8 +157,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,3:15:85-3:18:88", "value": [ { - "string": "int", - "raw_string": "int" + "string": "int" } ] } @@ -192,8 +189,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,4:13:102-4:19:108", "value": [ { - "string": "string", - "raw_string": "string" + "string": "string" } ] } @@ -225,8 +221,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,5:7:116-5:10:119", "value": [ { - "string": "int", - "raw_string": "int" + "string": "int" } ] } @@ -292,8 +287,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:27:147-6:38:158", "value": [ { - "string": "foreign_key", - "raw_string": "foreign_key" + "string": "foreign_key" } ] } @@ -364,8 +358,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:30:190-7:41:201", "value": [ { - "string": "foreign_key", - "raw_string": "foreign_key" + "string": "foreign_key" } ] } @@ -431,8 +424,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,11:9:243-11:18:252", "value": [ { - "string": "sql_table", - "raw_string": "sql_table" + "string": "sql_table" } ] } @@ -464,8 +456,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,12:6:259-12:9:262", "value": [ { - "string": "int", - "raw_string": "int" + "string": "int" } ] } @@ -531,8 +522,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:31:294-13:42:305", "value": [ { - "string": "foreign_key", - "raw_string": "foreign_key" + "string": "foreign_key" } ] } @@ -603,8 +593,7 @@ "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:30:337-14:41:348", "value": [ { - "string": "foreign_key", - "raw_string": "foreign_key" + "string": "foreign_key" } ] } diff --git a/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json b/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json index 75999c067..31148f447 100644 --- a/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json +++ b/testdata/d2compiler/TestCompile2/boards/isFolderOnly.exp.json @@ -253,8 +253,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly.d2,12:13:130-12:26:143", "value": [ { - "string": "one two three", - "raw_string": "one two three" + "string": "one two three" } ] } @@ -608,8 +607,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly.d2,12:13:130-12:26:143", "value": [ { - "string": "one two three", - "raw_string": "one two three" + "string": "one two three" } ] } @@ -882,8 +880,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/boards/isFolderOnly.d2,12:13:130-12:26:143", "value": [ { - "string": "one two three", - "raw_string": "one two three" + "string": "one two three" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/combined.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/combined.exp.json index f03a3b5ca..091481ef5 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/combined.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/combined.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/combined.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -92,31 +91,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/combined.d2,4:4:29-4:12:37", "value": [ { - "string": "1 ", - "raw_string": "1 " - }, - { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/combined.d2,4:6:31-4:10:35", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/combined.d2,4:8:33-4:9:34", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } - }, - { - "string": " 2", - "raw_string": "1 2" + "string": "1 im a var 2" } ] } @@ -177,7 +152,7 @@ ], "attributes": { "label": { - "value": "1 " + "value": "1 im a var 2" }, "labelDimensions": { "width": 0, diff --git a/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.exp.json new file mode 100644 index 000000000..1be8d8d91 --- /dev/null +++ b/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.exp.json @@ -0,0 +1,176 @@ +{ + "graph": { + "name": "", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,0:0:0-5:0:40", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,1:0:1-3:1:24", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,1:0:1-1:4:5", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,1:0:1-1:4:5", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,1:6:7-3:1:24", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,2:2:11-2:13:22", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,2:2:11-2:3:12", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,2:2:11-2:3:12", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,2:5:14-2:13:22", + "value": [ + { + "string": "im a var" + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,4:0:25-4:14:39", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,4:0:25-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,4:0:25-4:2:27", + "value": [ + { + "string": "hi", + "raw_string": "hi" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "double_quoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,4:4:29-4:14:39", + "value": [ + { + "string": "1 im a var 2" + } + ] + } + } + } + } + ] + }, + "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": "hi", + "id_val": "hi", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,4:0:25-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/double-quoted.d2,4:0:25-4:2:27", + "value": [ + { + "string": "hi", + "raw_string": "hi" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "1 im a var 2" + }, + "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/TestCompile2/vars/basic/edge_label.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/edge_label.exp.json index 55c12d65d..9f1b92d8d 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/edge_label.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/edge_label.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge_label.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -111,20 +110,11 @@ ], "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge_label.d2,4:8:33-4:12:37", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge_label.d2,2:5:14-2:13:22", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge_label.d2,4:10:35-4:11:36", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im a var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/label.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/label.exp.json index 41f1864ae..3d376033f 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/label.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/label.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/label.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -88,20 +87,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/label.d2,4:4:29-4:8:33", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/label.d2,2:5:14-2:13:22", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/label.d2,4:6:31-4:7:32", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im a var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/nested.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/nested.exp.json index b0bc434b4..37a8d3819 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/nested.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/nested.exp.json @@ -102,8 +102,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/nested.d2,4:14:49-4:17:52", "value": [ { - "string": "red", - "raw_string": "red" + "string": "red" } ] } @@ -181,42 +180,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/nested.d2,9:14:85-9:38:109", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/nested.d2,4:14:49-4:17:52", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/nested.d2,9:16:87-9:22:93", - "value": [ - { - "string": "colors", - "raw_string": "colors" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/nested.d2,9:23:94-9:30:101", - "value": [ - { - "string": "primary", - "raw_string": "primary" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/nested.d2,9:31:102-9:37:108", - "value": [ - { - "string": "button", - "raw_string": "button" - } - ] - } + "string": "red" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/number.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/number.exp.json index b9898d320..a7a5fb0e5 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/number.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/number.exp.json @@ -108,22 +108,10 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/number.d2,5:15:44-5:25:54", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/number.d2,5:17:46-5:24:53", - "value": [ - { - "string": "columns", - "raw_string": "columns" - } - ] - } - } - ] + "number": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/number.d2,2:10:19-2:11:20", + "raw": "2", + "value": "2" } } } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.exp.json new file mode 100644 index 000000000..f2717ee09 --- /dev/null +++ b/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.exp.json @@ -0,0 +1,173 @@ +{ + "graph": { + "name": "", + "isFolderOnly": false, + "ast": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,0:0:0-5:0:40", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,1:0:1-3:1:24", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,1:0:1-1:4:5", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,1:0:1-1:4:5", + "value": [ + { + "string": "vars", + "raw_string": "vars" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,1:6:7-3:1:24", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,2:2:11-2:13:22", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,2:2:11-2:3:12", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,2:2:11-2:3:12", + "value": [ + { + "string": "x", + "raw_string": "x" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,2:5:14-2:13:22", + "value": [ + { + "string": "im a var" + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,4:0:25-4:14:39", + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,4:0:25-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,4:0:25-4:2:27", + "value": [ + { + "string": "hi", + "raw_string": "hi" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "single_quoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,4:4:29-4:14:39", + "raw": "", + "value": "1 ${x} 2" + } + } + } + } + ] + }, + "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": "hi", + "id_val": "hi", + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,4:0:25-4:2:27", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/single-quoted.d2,4:0:25-4:2:27", + "value": [ + { + "string": "hi", + "raw_string": "hi" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": -1 + } + ], + "attributes": { + "label": { + "value": "1 ${x} 2" + }, + "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/TestCompile2/vars/basic/style.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/style.exp.json index 6925d574c..43318c722 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/style.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/style.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/style.d2,2:17:26-2:20:29", "value": [ { - "string": "red", - "raw_string": "red" + "string": "red" } ] } @@ -123,20 +122,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/style.d2,5:14:52-5:30:68", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/style.d2,2:17:26-2:20:29", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/style.d2,5:16:54-5:29:67", - "value": [ - { - "string": "primary-color", - "raw_string": "primary-color" - } - ] - } + "string": "red" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json index a336caf0b..7bde70cfe 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -136,20 +135,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,7:8:51-7:12:55", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,2:5:14-2:13:22", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,7:10:53-7:11:54", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im a var" } ] } @@ -246,8 +236,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -283,8 +272,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json index a256b8aab..01550e52a 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -164,8 +163,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,8:9:67-8:17:75", "value": [ { - "string": "im y var", - "raw_string": "im y var" + "string": "im y var" } ] } @@ -198,20 +196,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,10:7:89-10:11:93", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,10:9:91-10:10:92", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im x var" } ] } @@ -239,20 +228,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,11:7:101-11:11:105", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,8:9:67-8:17:75", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,11:9:103-11:10:104", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } + "string": "im y var" } ] } @@ -366,8 +346,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,17:9:151-17:17:159", "value": [ { - "string": "im y var", - "raw_string": "im y var" + "string": "im y var" } ] } @@ -400,20 +379,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,19:7:173-19:11:177", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,19:9:175-19:10:176", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im x var" } ] } @@ -441,20 +411,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,20:7:185-20:11:189", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,17:9:151-17:17:159", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,20:9:187-20:10:188", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } + "string": "im y var" } ] } @@ -551,8 +512,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -583,8 +543,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,17:9:151-17:17:159", "value": [ { - "string": "im y var", - "raw_string": "im y var" + "string": "im y var" } ] } @@ -620,8 +579,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -652,8 +610,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,17:9:151-17:17:159", "value": [ { - "string": "im y var", - "raw_string": "im y var" + "string": "im y var" } ] } @@ -834,8 +791,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -866,8 +822,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,8:9:67-8:17:75", "value": [ { - "string": "im y var", - "raw_string": "im y var" + "string": "im y var" } ] } @@ -903,8 +858,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -935,8 +889,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,8:9:67-8:17:75", "value": [ { - "string": "im y var", - "raw_string": "im y var" + "string": "im y var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json index a5a4d56e9..ad2348046 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json @@ -3,7 +3,7 @@ "name": "", "isFolderOnly": false, "ast": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,0:0:0-21:0:190", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,0:0:0-13:0:109", "nodes": [ { "map_key": { @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,2:5:14-2:13:22", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -164,8 +163,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,8:9:67-8:26:84", "value": [ { - "string": "im replaced x var", - "raw_string": "im replaced x var" + "string": "im replaced x var" } ] } @@ -198,181 +196,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,10:7:98-10:11:102", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,8:9:67-8:26:84", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,10:9:100-10:10:101", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } - } - } - } - ] - } - } - } - } - ] - } - } - } - }, - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,13:0:109-20:1:189", - "key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,13:0:109-13:6:115", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,13:0:109-13:6:115", - "value": [ - { - "string": "layers", - "raw_string": "layers" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,13:8:117-20:1:189", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,14:2:121-19:3:187", - "key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,14:2:121-14:4:123", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,14:2:121-14:4:123", - "value": [ - { - "string": "l2", - "raw_string": "l2" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,14:6:125-19:3:187", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,15:4:131-17:5:171", - "key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,15:4:131-15:8:135", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,15:4:131-15:8:135", - "value": [ - { - "string": "vars", - "raw_string": "vars" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,15:10:137-17:5:171", - "nodes": [ - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,16:6:145-16:26:165", - "key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,16:6:145-16:7:146", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,16:6:145-16:7:146", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,16:9:148-16:26:165", - "value": [ - { - "string": "im replaced x var", - "raw_string": "im replaced x var" - } - ] - } - } - } - } - ] - } - } - } - }, - { - "map_key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,18:4:176-18:11:183", - "key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,18:4:176-18:5:177", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,18:4:176-18:5:177", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,18:7:179-18:11:183", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,18:9:181-18:10:182", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im replaced x var" } ] } @@ -416,180 +244,6 @@ }, "edges": null, "objects": null, - "layers": [ - { - "name": "l2", - "isFolderOnly": false, - "ast": { - "range": ",1:0:0-2: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": "vars" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "map": { - "range": ",1:0:0-2: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": { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,16:9:148-16:26:165", - "value": [ - { - "string": "im replaced x var", - "raw_string": "im replaced x var" - } - ] - } - }, - "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": "x" - } - ] - } - } - ] - }, - "primary": { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,16:9:148-16:26:165", - "value": [ - { - "string": "im replaced x var", - "raw_string": "im replaced x var" - } - ] - } - }, - "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": "x", - "id_val": "x", - "references": [ - { - "key": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,18:4:176-18:5:177", - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,18:4:176-18:5:177", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - }, - "key_path_index": 0, - "map_key_edge_index": -1 - } - ], - "attributes": { - "label": { - "value": "im replaced x var" - }, - "labelDimensions": { - "width": 0, - "height": 0 - }, - "style": {}, - "near_key": null, - "shape": { - "value": "rectangle" - }, - "direction": { - "value": "" - }, - "constraint": null - }, - "zIndex": 0 - } - ] - } - ], "scenarios": [ { "name": "l", @@ -643,8 +297,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,8:9:67-8:26:84", "value": [ { - "string": "im replaced x var", - "raw_string": "im replaced x var" + "string": "im replaced x var" } ] } @@ -680,8 +333,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,8:9:67-8:26:84", "value": [ { - "string": "im replaced x var", - "raw_string": "im replaced x var" + "string": "im replaced x var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json index a4b99e65d..8c02a62f5 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -136,20 +135,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,7:8:54-7:12:58", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,2:5:14-2:13:22", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,7:10:56-7:11:57", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im a var" } ] } @@ -246,8 +236,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -283,8 +272,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/override/label.exp.json b/testdata/d2compiler/TestCompile2/vars/override/label.exp.json index 585e192ee..10ff44f21 100644 --- a/testdata/d2compiler/TestCompile2/vars/override/label.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/override/label.exp.json @@ -54,8 +54,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/override/label.d2,2:5:14-2:13:22", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } @@ -88,20 +87,11 @@ }, "primary": {}, "value": { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/label.d2,4:4:29-4:8:33", - "spread": false, - "path": [ + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile2/vars/override/label.d2,2:5:14-2:13:22", + "value": [ { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/label.d2,4:6:31-4:7:32", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } + "string": "im a var" } ] } @@ -133,8 +123,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/override/label.d2,5:4:38-5:13:47", "value": [ { - "string": "not a var", - "raw_string": "not a var" + "string": "not a var" } ] }