d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.exp.json
Anmol Sethi a79e963f3e
d2ir: Fix variables to passthrough primary type
If the variable is a number it should be parsed as a number and not coerced into a string.
See test change.
2023-07-18 14:58:22 -07:00

277 lines
9.2 KiB
JSON
Generated

{
"graph": {
"name": "",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,0:0:0-7:0:40",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,1:0:1-5:1:31",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,1:0:1-1:4:5",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,1:0:1-1:4:5",
"value": [
{
"string": "vars",
"raw_string": "vars"
}
]
}
}
]
},
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,1:6:7-5:1:31",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,2:1:10-4:3:29",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,2:1:10-2:2:11",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,2:1:10-2:2:11",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
},
"primary": {
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,2:4:13-2:7:16",
"value": [
{
"string": "all",
"raw_string": "all"
}
]
}
},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,2:8:17-4:3:29",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,3:2:21-3:6:25",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,3:2:21-3:3:22",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,3:2:21-3:3:22",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,3:5:24-3:6:25",
"value": [
{
"string": "b",
"raw_string": "b"
}
]
}
}
}
}
]
}
}
}
}
]
}
}
}
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:0:32-6:7:39",
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:0:32-6:1:33",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:0:32-6:1:33",
"value": [
{
"string": "z",
"raw_string": "z"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"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"
}
]
}
}
]
}
}
]
}
}
}
}
]
},
"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": "a",
"id_val": "a",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,3:2:21-3:3:22",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,3:2:21-3:3:22",
"value": [
{
"string": "a",
"raw_string": "a"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": -1
}
],
"attributes": {
"label": {
"value": "b"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
},
{
"id": "z",
"id_val": "z",
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:0:32-6:1:33",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile2/vars/basic/primary-and-composite.d2,6:0:32-6:1:33",
"value": [
{
"string": "z",
"raw_string": "z"
}
]
}
}
]
},
"key_path_index": 0,
"map_key_edge_index": -1
}
],
"attributes": {
"label": {
"value": "all"
},
"labelDimensions": {
"width": 0,
"height": 0
},
"style": {},
"near_key": null,
"shape": {
"value": "rectangle"
},
"direction": {
"value": ""
},
"constraint": null
},
"zIndex": 0
}
]
},
"err": null
}