diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index fdf1cc82f..b99b1a8c9 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -3337,7 +3337,7 @@ vars: { y: "hey ${x}" `, "") - assert.Equal(t, `hey "hi"`, g.Objects[0].Label.Value) + assert.Equal(t, `hey hi`, g.Objects[0].Label.Value) }, }, { diff --git a/d2ir/compile.go b/d2ir/compile.go index 0cdbe5c45..1aaa32150 100644 --- a/d2ir/compile.go +++ b/d2ir/compile.go @@ -199,13 +199,8 @@ func (c *compiler) resolveSubstitutions(varsStack []*Map, node Node) { n.Primary_ = nil } } else { - if len(s.Value) == 1 { - // If lone and unquoted, replace with value of sub - node.Primary().Value = resolvedField.Primary().Value - } else { - s.Value[i].String = go2.Pointer(resolvedField.Primary().String()) - subbed = true - } + s.Value[i].String = go2.Pointer(resolvedField.Primary().Value.ScalarString()) + subbed = true } if resolvedField.Composite != nil { switch n := node.(type) { @@ -241,7 +236,7 @@ func (c *compiler) resolveSubstitutions(varsStack []*Map, node Node) { c.errorf(node.LastRef().AST(), `cannot substitute map variable "%s" in quotes`, strings.Join(box.Substitution.IDA(), ".")) return } - s.Value[i].String = go2.Pointer(resolvedField.Primary().String()) + s.Value[i].String = go2.Pointer(resolvedField.Primary().Value.ScalarString()) subbed = true } } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/edge-label.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/edge-label.exp.json index 87391a571..4a85c4603 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/edge-label.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/edge-label.exp.json @@ -115,23 +115,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge-label.d2,4:8:33-4:9:34", "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,4:10:35-4:11:36", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im a var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/edge-map.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/edge-map.exp.json index cb64534ff..92d823330 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/edge-map.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/edge-map.exp.json @@ -150,23 +150,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge-map.d2,5:26:61-5:27:62", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge-map.d2,5:26:61-5:30:65", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/edge-map.d2,5:28:63-5:29:64", - "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 2b5c53b82..d32d26e50 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/nested.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/nested.exp.json @@ -185,45 +185,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/nested.d2,9:14:85-9:15:86", "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,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 a27ca9ad5..37d67c845 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/number.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/number.exp.json @@ -112,23 +112,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/number.d2,5:15:44-5:16:45", "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" - } - ] - } - } - ] - } + "string": "2" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/parent-scope.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/parent-scope.exp.json index b9d8924d5..5a3d26c1e 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/parent-scope.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/parent-scope.exp.json @@ -178,23 +178,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/parent-scope.d2,8:6:74-8:7:75", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/parent-scope.d2,8:6:74-8:10:78", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/parent-scope.d2,8:8:76-8:9:77", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im root var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.exp.json index f7ddb1d5c..bceafd191 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.exp.json @@ -131,23 +131,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:3:35-6:4:36", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:3:35-6:7:39", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:5:37-6:6:38", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "all" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/quoted-var-quoted-sub.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/quoted-var-quoted-sub.exp.json index 1004100aa..0ab13c79f 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/quoted-var-quoted-sub.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/quoted-var-quoted-sub.exp.json @@ -92,7 +92,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/quoted-var-quoted-sub.d2,5:3:25-5:13:35", "value": [ { - "string": "hey \"hi\"" + "string": "hey hi" } ] } @@ -153,7 +153,7 @@ ], "attributes": { "label": { - "value": "hey \"hi\"" + "value": "hey hi" }, "labelDimensions": { "width": 0, diff --git a/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.exp.json index ec1525372..24ca57ef5 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.exp.json @@ -227,45 +227,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.d2,12:10:131-12:11:132", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.d2,12:10:131-12:40:161", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.d2,12:12:133-12:25:146", - "value": [ - { - "string": "primaryColors", - "raw_string": "primaryColors" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.d2,12:26:147-12:32:153", - "value": [ - { - "string": "button", - "raw_string": "button" - } - ] - } - }, - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/quoted-var.d2,12:33:154-12:39:160", - "value": [ - { - "string": "active", - "raw_string": "active" - } - ] - } - } - ] - } + "string": "#4baae5" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/shape-label.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/shape-label.exp.json index faf48d651..29d85cf4e 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/shape-label.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/shape-label.exp.json @@ -92,23 +92,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/shape-label.d2,4:4:29-4:5:30", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/shape-label.d2,4:4:29-4:8:33", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/shape-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/style.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/style.exp.json index 9cd133ce4..11ae2fe4d 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/style.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/style.exp.json @@ -127,23 +127,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/style.d2,5:14:52-5:15:53", "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,5:16:54-5:29:67", - "value": [ - { - "string": "primary-color", - "raw_string": "primary-color" - } - ] - } - } - ] - } + "string": "red" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/basic/sub-array.exp.json b/testdata/d2compiler/TestCompile2/vars/basic/sub-array.exp.json index 0c182f344..0ad0ba9f3 100644 --- a/testdata/d2compiler/TestCompile2/vars/basic/sub-array.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/basic/sub-array.exp.json @@ -118,23 +118,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/sub-array.d2,4:13:32-4:14:33", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/sub-array.d2,4:13:32-4:17:36", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/basic/sub-array.d2,4:15:34-4:16:35", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "all" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json index 1edf3e182..bd02109b5 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/layer-2.exp.json @@ -235,23 +235,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,11:8:108-11:9:109", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,11:8:108-11:12:112", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,11:10:110-11:11:111", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "layer var x" } ] } @@ -283,23 +267,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,12:11:124-12:12:125", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,12:11:124-12:15:128", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,12:13:126-12:14:127", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - } + "string": "root var y" } ] } @@ -462,11 +430,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,9:9:82-9:20:93", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,11:8:108-11:9:109", "value": [ { - "string": "layer var x", - "raw_string": "layer var x" + "string": "layer var x" } ] } @@ -494,11 +461,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,3:5:30-3:15:40", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer-2.d2,12:11:124-12:12:125", "value": [ { - "string": "root var y", - "raw_string": "root var y" + "string": "root var y" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json b/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json index 2f2a237c8..7f3f693b1 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/layer.exp.json @@ -140,23 +140,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,7:8:51-7:9:52", "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,7:10:53-7:11:54", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im a var" } ] } @@ -287,11 +271,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,2:5:14-2:13:22", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/layer.d2,7:8:51-7:9:52", "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 b2557d9b0..23431936c 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/overlay.exp.json @@ -202,23 +202,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,10:7:89-10:8:90", "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,10:9:91-10:10:92", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im x var" } ] } @@ -250,23 +234,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,11:7:101-11:8:102", "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,11:9:103-11:10:104", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - } + "string": "im y var" } ] } @@ -418,23 +386,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,19:7:173-19:8:174", "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,19:9:175-19:10:176", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im x var" } ] } @@ -466,23 +418,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,20:7:185-20:8:186", "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,20:9:187-20:10:188", - "value": [ - { - "string": "y", - "raw_string": "y" - } - ] - } - } - ] - } + "string": "im y var" } ] } @@ -645,11 +581,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,19:7:173-19:8:174", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -677,11 +612,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,17:9:151-17:17:159", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,20:7:185-20:8:186", "value": [ { - "string": "im y var", - "raw_string": "im y var" + "string": "im y var" } ] } @@ -928,11 +862,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,2:5:14-2:13:22", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,10:7:89-10:8:90", "value": [ { - "string": "im x var", - "raw_string": "im x var" + "string": "im x var" } ] } @@ -960,11 +893,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,8:9:67-8:17:75", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/overlay.d2,11:7:101-11:8:102", "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 86ad2c0cb..fc75006dd 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/replace.exp.json @@ -202,23 +202,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,10:7:98-10:8:99", "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,10:9:100-10:10:101", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im replaced x var" } ] } @@ -349,11 +333,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,8:9:67-8:26:84", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/replace.d2,10:7:98-10:8:99", "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 1da21aa14..571e94ad8 100644 --- a/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/boards/scenario.exp.json @@ -140,23 +140,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,7:8:54-7:9:55", "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,7:10:56-7:11:57", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im a var" } ] } @@ -287,11 +271,10 @@ }, "primary": { "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,2:5:14-2:13:22", + "range": "d2/testdata/d2compiler/TestCompile2/vars/boards/scenario.d2,7:8:54-7:9:55", "value": [ { - "string": "im a var", - "raw_string": "im a var" + "string": "im a var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/override/map.exp.json b/testdata/d2compiler/TestCompile2/vars/override/map.exp.json index 11208a29b..cd5169258 100644 --- a/testdata/d2compiler/TestCompile2/vars/override/map.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/override/map.exp.json @@ -178,23 +178,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/override/map.d2,8:6:74-8:7:75", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/map.d2,8:6:74-8:10:78", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/map.d2,8:8:76-8:9:77", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "im nested var" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/override/recursive-var.exp.json b/testdata/d2compiler/TestCompile2/vars/override/recursive-var.exp.json index 19277bee2..25f7bf6a0 100644 --- a/testdata/d2compiler/TestCompile2/vars/override/recursive-var.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/override/recursive-var.exp.json @@ -177,23 +177,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/override/recursive-var.d2,8:6:58-8:7:59", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/recursive-var.d2,8:6:58-8:10:62", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/recursive-var.d2,8:8:60-8:9:61", - "value": [ - { - "string": "x", - "raw_string": "x" - } - ] - } - } - ] - } + "string": "a-b" } ] } diff --git a/testdata/d2compiler/TestCompile2/vars/override/var-in-var.exp.json b/testdata/d2compiler/TestCompile2/vars/override/var-in-var.exp.json index 6f41e1fad..f6beaba86 100644 --- a/testdata/d2compiler/TestCompile2/vars/override/var-in-var.exp.json +++ b/testdata/d2compiler/TestCompile2/vars/override/var-in-var.exp.json @@ -209,23 +209,7 @@ "range": "d2/testdata/d2compiler/TestCompile2/vars/override/var-in-var.d2,9:6:104-9:7:105", "value": [ { - "substitution": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/var-in-var.d2,9:6:104-9:15:113", - "spread": false, - "path": [ - { - "unquoted_string": { - "range": "d2/testdata/d2compiler/TestCompile2/vars/override/var-in-var.d2,9:8:106-9:14:112", - "value": [ - { - "string": "trade1", - "raw_string": "trade1" - } - ] - } - } - ] - } + "string": "BlackSmith" } ] }