d2/testdata/d2ir/TestCompile/imports/spread.exp.json
Anmol Sethi 2fcc9ed140
d2ir: Compile imports
Works as so:

index.d2:
```d2
x: @x
```

x.d2:
```d2
label: meow
shape: circle
```

TODO:

- [ ] Correctly import into fields by handling the scenarios/steps overlay.
      - And links.
- [ ] Test every kind of import.
2023-06-04 23:31:18 -07:00

82 lines
1.9 KiB
JSON
Generated

{
"fields": [
{
"name": "x",
"primary": {
"value": {
"range": "x.d2,0:3:3-0:7:7",
"value": [
{
"string": "wowa",
"raw_string": "wowa"
}
]
}
},
"references": [
{
"string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
},
"key_path": {
"range": "x.d2,0:0:0-0:1:1",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "x.d2,0:0:0-0:7:7",
"key": {
"range": "x.d2,0:0:0-0:1:1",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"range": "x.d2,0:3:3-0:7:7",
"value": [
{
"string": "wowa",
"raw_string": "wowa"
}
]
}
}
}
}
}
]
}
],
"edges": null
}