d2ir: Fix link paths to be unquoted strings

Allows for simpler manipulation.
This commit is contained in:
Anmol Sethi 2023-06-06 22:37:56 -07:00
parent 8857f46110
commit 986f069c18
No known key found for this signature in database
GPG key ID: 8CEF1878FF10ADEB
8 changed files with 913 additions and 96 deletions

View file

@ -253,8 +253,8 @@ func (c *compiler) updateLinks(m *Map) {
if len(bida) != len(aida) {
prependIDA := aida[:len(aida)-len(bida)]
kp := d2ast.MakeKeyPath(prependIDA)
s := d2format.Format(kp) + "." + f.Primary_.Value.ScalarString()
f.Primary_.Value = d2ast.MakeValueBox(d2ast.RawString(s, true)).ScalarBox().Unbox()
s := d2format.Format(kp) + strings.TrimPrefix(f.Primary_.Value.ScalarString(), "root")
f.Primary_.Value = d2ast.MakeValueBox(d2ast.FlatUnquotedString(s)).ScalarBox().Unbox()
}
}
if f.Map() != nil {
@ -322,7 +322,7 @@ func (c *compiler) compileLink(refctx *RefContext) {
// Create the absolute path by appending scope path with value specified
scopeIDA = append(scopeIDA, linkIDA...)
kp := d2ast.MakeKeyPath(scopeIDA)
refctx.Key.Value = d2ast.MakeValueBox(d2ast.RawString(d2format.Format(kp), true))
refctx.Key.Value = d2ast.MakeValueBox(d2ast.FlatUnquotedString(d2format.Format(kp)))
}
func (c *compiler) compileEdges(refctx *RefContext) {

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.4.2-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 304 285"><svg id="d2-svg" class="d2-1110812327" width="304" height="285" viewBox="-101 -118 304 285"><rect x="-101.000000" y="-118.000000" width="304.000000" height="285.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.4.2-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 304 285"><svg id="d2-svg" class="d2-2067460405" width="304" height="285" viewBox="-101 -118 304 285"><rect x="-101.000000" y="-118.000000" width="304.000000" height="285.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
.appendix-icon {
filter: drop-shadow(0px 0px 32px rgba(31, 36, 58, 0.1));
}
.d2-1110812327 .text-bold {
font-family: "d2-1110812327-font-bold";
.d2-2067460405 .text-bold {
font-family: "d2-2067460405-font-bold";
}
@font-face {
font-family: d2-1110812327-font-bold;
font-family: d2-2067460405-font-bold;
src: url("data:application/font-woff;base64,d09GRgABAAAAAAlYAAoAAAAADsQAAguFAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAAA9AAAAGAAAABgXxHXrmNtYXAAAAFUAAAAZgAAAIQB3wKvZ2x5ZgAAAbwAAAN9AAAEFMTSfgtoZWFkAAAFPAAAADYAAAA2G38e1GhoZWEAAAV0AAAAJAAAACQKfwXNaG10eAAABZgAAAA4AAAAOBfHAeJsb2NhAAAF0AAAAB4AAAAeCbYIom1heHAAAAXwAAAAIAAAACAAJgD3bmFtZQAABhAAAAMoAAAIKgjwVkFwb3N0AAAJOAAAAB0AAAAg/9EAMgADAioCvAAFAAACigJYAAAASwKKAlgAAAFeADIBKQAAAgsHAwMEAwICBGAAAvcAAAADAAAAAAAAAABBREJPACAAIP//Au7/BgAAA9gBESAAAZ8AAAAAAfAClAAAACAAA3icZMw9DgFRAEbR88z4Vyisg8yeiGgoJGIZRKHAvhT28kleJ255i4OiUTDTOmBhrtFa6Wxs7ewdnZwTLHXWvzefvPPKM4/cc8s1l+r9NzE1VvSq3zcwNOILAAD//wEAAP///akafwAAeJxMU0tvG1UUPvfO1FNPJmnG87Kd+DUTz52xXYf4ziOOm6aJ04RGWHWCgKLmUbLgoUSqBEUJj19QVIGUCIUuAkIgxKILVLGgElukCHZBQkJiwbYLMJXFyvFUM0mlLkYzo3vOd77vfN+Fc9AGwJt4HxiIwwVIgAJAxYJYpIQ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TaBhU03X1DQQ18S0H2mn1vn78s31uqU85YiUmPBfL8AzPJrsc8AhY2UY6GZur0NTL0STlxyq+ksiWQ2l58giHODxnAMOeMnzd/q4ZOKMi1txWc/d4pgjuhx+UBUL+y5HvF59+/+sv4tpU7U4nq5OL+49xSd3UOsX2rPb97KniZWTmFu02604I2BacnG76zW5x3j/AAAA//8BAAD///S3T1F4nGJgZgCD/+cYjBiwAAAAAAD//wEAAP//LwECAwAAAA==");
}]]></style><style type="text/css"><![CDATA[.shape {
shape-rendering: geometricPrecision;
@ -21,78 +21,78 @@
opacity: 0.5;
}
.d2-1110812327 .fill-N1{fill:#0A0F25;}
.d2-1110812327 .fill-N2{fill:#676C7E;}
.d2-1110812327 .fill-N3{fill:#9499AB;}
.d2-1110812327 .fill-N4{fill:#CFD2DD;}
.d2-1110812327 .fill-N5{fill:#DEE1EB;}
.d2-1110812327 .fill-N6{fill:#EEF1F8;}
.d2-1110812327 .fill-N7{fill:#FFFFFF;}
.d2-1110812327 .fill-B1{fill:#0D32B2;}
.d2-1110812327 .fill-B2{fill:#0D32B2;}
.d2-1110812327 .fill-B3{fill:#E3E9FD;}
.d2-1110812327 .fill-B4{fill:#E3E9FD;}
.d2-1110812327 .fill-B5{fill:#EDF0FD;}
.d2-1110812327 .fill-B6{fill:#F7F8FE;}
.d2-1110812327 .fill-AA2{fill:#4A6FF3;}
.d2-1110812327 .fill-AA4{fill:#EDF0FD;}
.d2-1110812327 .fill-AA5{fill:#F7F8FE;}
.d2-1110812327 .fill-AB4{fill:#EDF0FD;}
.d2-1110812327 .fill-AB5{fill:#F7F8FE;}
.d2-1110812327 .stroke-N1{stroke:#0A0F25;}
.d2-1110812327 .stroke-N2{stroke:#676C7E;}
.d2-1110812327 .stroke-N3{stroke:#9499AB;}
.d2-1110812327 .stroke-N4{stroke:#CFD2DD;}
.d2-1110812327 .stroke-N5{stroke:#DEE1EB;}
.d2-1110812327 .stroke-N6{stroke:#EEF1F8;}
.d2-1110812327 .stroke-N7{stroke:#FFFFFF;}
.d2-1110812327 .stroke-B1{stroke:#0D32B2;}
.d2-1110812327 .stroke-B2{stroke:#0D32B2;}
.d2-1110812327 .stroke-B3{stroke:#E3E9FD;}
.d2-1110812327 .stroke-B4{stroke:#E3E9FD;}
.d2-1110812327 .stroke-B5{stroke:#EDF0FD;}
.d2-1110812327 .stroke-B6{stroke:#F7F8FE;}
.d2-1110812327 .stroke-AA2{stroke:#4A6FF3;}
.d2-1110812327 .stroke-AA4{stroke:#EDF0FD;}
.d2-1110812327 .stroke-AA5{stroke:#F7F8FE;}
.d2-1110812327 .stroke-AB4{stroke:#EDF0FD;}
.d2-1110812327 .stroke-AB5{stroke:#F7F8FE;}
.d2-1110812327 .background-color-N1{background-color:#0A0F25;}
.d2-1110812327 .background-color-N2{background-color:#676C7E;}
.d2-1110812327 .background-color-N3{background-color:#9499AB;}
.d2-1110812327 .background-color-N4{background-color:#CFD2DD;}
.d2-1110812327 .background-color-N5{background-color:#DEE1EB;}
.d2-1110812327 .background-color-N6{background-color:#EEF1F8;}
.d2-1110812327 .background-color-N7{background-color:#FFFFFF;}
.d2-1110812327 .background-color-B1{background-color:#0D32B2;}
.d2-1110812327 .background-color-B2{background-color:#0D32B2;}
.d2-1110812327 .background-color-B3{background-color:#E3E9FD;}
.d2-1110812327 .background-color-B4{background-color:#E3E9FD;}
.d2-1110812327 .background-color-B5{background-color:#EDF0FD;}
.d2-1110812327 .background-color-B6{background-color:#F7F8FE;}
.d2-1110812327 .background-color-AA2{background-color:#4A6FF3;}
.d2-1110812327 .background-color-AA4{background-color:#EDF0FD;}
.d2-1110812327 .background-color-AA5{background-color:#F7F8FE;}
.d2-1110812327 .background-color-AB4{background-color:#EDF0FD;}
.d2-1110812327 .background-color-AB5{background-color:#F7F8FE;}
.d2-1110812327 .color-N1{color:#0A0F25;}
.d2-1110812327 .color-N2{color:#676C7E;}
.d2-1110812327 .color-N3{color:#9499AB;}
.d2-1110812327 .color-N4{color:#CFD2DD;}
.d2-1110812327 .color-N5{color:#DEE1EB;}
.d2-1110812327 .color-N6{color:#EEF1F8;}
.d2-1110812327 .color-N7{color:#FFFFFF;}
.d2-1110812327 .color-B1{color:#0D32B2;}
.d2-1110812327 .color-B2{color:#0D32B2;}
.d2-1110812327 .color-B3{color:#E3E9FD;}
.d2-1110812327 .color-B4{color:#E3E9FD;}
.d2-1110812327 .color-B5{color:#EDF0FD;}
.d2-1110812327 .color-B6{color:#F7F8FE;}
.d2-1110812327 .color-AA2{color:#4A6FF3;}
.d2-1110812327 .color-AA4{color:#EDF0FD;}
.d2-1110812327 .color-AA5{color:#F7F8FE;}
.d2-1110812327 .color-AB4{color:#EDF0FD;}
.d2-1110812327 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><a href="x/index.svg" xlink:href="x/index.svg"><g id="x"><g class="shape" ><rect x="0.000000" y="0.000000" width="85.000000" height="66.000000" class=" stroke-B1 fill-B6" style="stroke-width:2;" /></g><text x="42.500000" y="38.500000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">x</text><g transform="translate(69 -16)" class="appendix-icon"><svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
.d2-2067460405 .fill-N1{fill:#0A0F25;}
.d2-2067460405 .fill-N2{fill:#676C7E;}
.d2-2067460405 .fill-N3{fill:#9499AB;}
.d2-2067460405 .fill-N4{fill:#CFD2DD;}
.d2-2067460405 .fill-N5{fill:#DEE1EB;}
.d2-2067460405 .fill-N6{fill:#EEF1F8;}
.d2-2067460405 .fill-N7{fill:#FFFFFF;}
.d2-2067460405 .fill-B1{fill:#0D32B2;}
.d2-2067460405 .fill-B2{fill:#0D32B2;}
.d2-2067460405 .fill-B3{fill:#E3E9FD;}
.d2-2067460405 .fill-B4{fill:#E3E9FD;}
.d2-2067460405 .fill-B5{fill:#EDF0FD;}
.d2-2067460405 .fill-B6{fill:#F7F8FE;}
.d2-2067460405 .fill-AA2{fill:#4A6FF3;}
.d2-2067460405 .fill-AA4{fill:#EDF0FD;}
.d2-2067460405 .fill-AA5{fill:#F7F8FE;}
.d2-2067460405 .fill-AB4{fill:#EDF0FD;}
.d2-2067460405 .fill-AB5{fill:#F7F8FE;}
.d2-2067460405 .stroke-N1{stroke:#0A0F25;}
.d2-2067460405 .stroke-N2{stroke:#676C7E;}
.d2-2067460405 .stroke-N3{stroke:#9499AB;}
.d2-2067460405 .stroke-N4{stroke:#CFD2DD;}
.d2-2067460405 .stroke-N5{stroke:#DEE1EB;}
.d2-2067460405 .stroke-N6{stroke:#EEF1F8;}
.d2-2067460405 .stroke-N7{stroke:#FFFFFF;}
.d2-2067460405 .stroke-B1{stroke:#0D32B2;}
.d2-2067460405 .stroke-B2{stroke:#0D32B2;}
.d2-2067460405 .stroke-B3{stroke:#E3E9FD;}
.d2-2067460405 .stroke-B4{stroke:#E3E9FD;}
.d2-2067460405 .stroke-B5{stroke:#EDF0FD;}
.d2-2067460405 .stroke-B6{stroke:#F7F8FE;}
.d2-2067460405 .stroke-AA2{stroke:#4A6FF3;}
.d2-2067460405 .stroke-AA4{stroke:#EDF0FD;}
.d2-2067460405 .stroke-AA5{stroke:#F7F8FE;}
.d2-2067460405 .stroke-AB4{stroke:#EDF0FD;}
.d2-2067460405 .stroke-AB5{stroke:#F7F8FE;}
.d2-2067460405 .background-color-N1{background-color:#0A0F25;}
.d2-2067460405 .background-color-N2{background-color:#676C7E;}
.d2-2067460405 .background-color-N3{background-color:#9499AB;}
.d2-2067460405 .background-color-N4{background-color:#CFD2DD;}
.d2-2067460405 .background-color-N5{background-color:#DEE1EB;}
.d2-2067460405 .background-color-N6{background-color:#EEF1F8;}
.d2-2067460405 .background-color-N7{background-color:#FFFFFF;}
.d2-2067460405 .background-color-B1{background-color:#0D32B2;}
.d2-2067460405 .background-color-B2{background-color:#0D32B2;}
.d2-2067460405 .background-color-B3{background-color:#E3E9FD;}
.d2-2067460405 .background-color-B4{background-color:#E3E9FD;}
.d2-2067460405 .background-color-B5{background-color:#EDF0FD;}
.d2-2067460405 .background-color-B6{background-color:#F7F8FE;}
.d2-2067460405 .background-color-AA2{background-color:#4A6FF3;}
.d2-2067460405 .background-color-AA4{background-color:#EDF0FD;}
.d2-2067460405 .background-color-AA5{background-color:#F7F8FE;}
.d2-2067460405 .background-color-AB4{background-color:#EDF0FD;}
.d2-2067460405 .background-color-AB5{background-color:#F7F8FE;}
.d2-2067460405 .color-N1{color:#0A0F25;}
.d2-2067460405 .color-N2{color:#676C7E;}
.d2-2067460405 .color-N3{color:#9499AB;}
.d2-2067460405 .color-N4{color:#CFD2DD;}
.d2-2067460405 .color-N5{color:#DEE1EB;}
.d2-2067460405 .color-N6{color:#EEF1F8;}
.d2-2067460405 .color-N7{color:#FFFFFF;}
.d2-2067460405 .color-B1{color:#0D32B2;}
.d2-2067460405 .color-B2{color:#0D32B2;}
.d2-2067460405 .color-B3{color:#E3E9FD;}
.d2-2067460405 .color-B4{color:#E3E9FD;}
.d2-2067460405 .color-B5{color:#EDF0FD;}
.d2-2067460405 .color-B6{color:#F7F8FE;}
.d2-2067460405 .color-AA2{color:#4A6FF3;}
.d2-2067460405 .color-AA4{color:#EDF0FD;}
.d2-2067460405 .color-AA5{color:#F7F8FE;}
.d2-2067460405 .color-AB4{color:#EDF0FD;}
.d2-2067460405 .color-AB5{color:#F7F8FE;}.appendix text.text{fill:#0A0F25}.md{--color-fg-default:#0A0F25;--color-fg-muted:#676C7E;--color-fg-subtle:#9499AB;--color-canvas-default:#FFFFFF;--color-canvas-subtle:#EEF1F8;--color-border-default:#0D32B2;--color-border-muted:#0D32B2;--color-neutral-muted:#EEF1F8;--color-accent-fg:#0D32B2;--color-accent-emphasis:#0D32B2;--color-attention-subtle:#676C7E;--color-danger-fg:red;}.sketch-overlay-B1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B2{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-B3{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-B6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-AA4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AA5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB4{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-AB5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N1{fill:url(#streaks-darker);mix-blend-mode:lighten}.sketch-overlay-N2{fill:url(#streaks-dark);mix-blend-mode:overlay}.sketch-overlay-N3{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N4{fill:url(#streaks-normal);mix-blend-mode:color-burn}.sketch-overlay-N5{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N6{fill:url(#streaks-bright);mix-blend-mode:darken}.sketch-overlay-N7{fill:url(#streaks-bright);mix-blend-mode:darken}.light-code{display: block}.dark-code{display: none}]]></style><a href="x/index.svg" xlink:href="x/index.svg"><g id="x"><g class="shape" ><rect x="0.000000" y="0.000000" width="85.000000" height="66.000000" class=" stroke-B1 fill-B6" style="stroke-width:2;" /></g><text x="42.500000" y="38.500000" class="text-bold fill-N1" style="text-anchor:middle;font-size:16px">x</text><g transform="translate(69 -16)" class="appendix-icon"><svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_3440_35088111)">
<path d="M16 31.1109C24.3456 31.1109 31.1111 24.3454 31.1111 15.9998C31.1111 7.65415 24.3456 0.888672 16 0.888672C7.65436 0.888672 0.888885 7.65415 0.888885 15.9998C0.888885 24.3454 7.65436 31.1109 16 31.1109Z" fill="white" stroke="#DEE1EB"/>
<path d="M14.3909 16.7965C14.7364 17.2584 15.1772 17.6406 15.6834 17.9171C16.1896 18.1938 16.7494 18.3582 17.3248 18.3993C17.9001 18.4405 18.4777 18.3575 19.0181 18.1559C19.5586 17.9543 20.0492 17.6389 20.4571 17.2309L22.8708 14.8173C23.6036 14.0586 24.0089 13.0425 23.9998 11.9877C23.9906 10.933 23.5676 9.92404 22.8217 9.17821C22.0759 8.43237 21.067 8.00931 20.0123 8.00015C18.9575 7.99098 17.9413 8.39644 17.1827 9.1292L15.7988 10.505" stroke="#2E3346" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
@ -104,7 +104,7 @@
</clipPath>
</defs>
</svg>
</g></g></a><mask id="d2-1110812327" maskUnits="userSpaceOnUse" x="-101" y="-118" width="304" height="285">
</g></g></a><mask id="d2-2067460405" maskUnits="userSpaceOnUse" x="-101" y="-118" width="304" height="285">
<rect x="-101" y="-118" width="304" height="285" fill="white"></rect>
</mask></svg></svg>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -61,7 +61,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -359,7 +359,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{

View file

@ -70,7 +70,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -491,7 +491,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -960,7 +960,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{

View file

@ -37,7 +37,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -317,7 +317,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -535,7 +535,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{

View file

@ -37,7 +37,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -259,7 +259,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{

View file

@ -179,7 +179,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -222,7 +222,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -511,7 +511,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -554,7 +554,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -843,7 +843,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
@ -886,7 +886,7 @@
},
"primary": {},
"value": {
"double_quoted_string": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{

817
testdata/d2ir/TestCompile/imports/boards.exp.json generated vendored Normal file
View file

@ -0,0 +1,817 @@
{
"fields": [
{
"name": "x",
"composite": {
"fields": [
{
"name": "link",
"primary": {
"value": {
"range": ",0:0:0-0:0:0",
"value": [
{
"string": "root.layers.x"
}
]
}
},
"references": [
{
"string": {
"range": "index.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
},
"key_path": {
"range": "index.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
},
{
"unquoted_string": {
"range": "index.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "index.d2,0:0:0-0:16:16",
"key": {
"range": "index.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
},
{
"unquoted_string": {
"range": "index.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
"string": "root.layers.x"
}
]
}
}
}
}
}
]
}
],
"edges": null
},
"references": [
{
"string": {
"range": "index.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
},
"key_path": {
"range": "index.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
},
{
"unquoted_string": {
"range": "index.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "index.d2,0:0:0-0:16:16",
"key": {
"range": "index.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:0:0-0:1:1",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
},
{
"unquoted_string": {
"range": "index.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
"string": "root.layers.x"
}
]
}
}
}
}
}
]
},
{
"name": "layers",
"composite": {
"fields": [
{
"name": "x",
"composite": {
"fields": [
{
"name": "y",
"composite": {
"fields": [
{
"name": "link",
"primary": {
"value": {
"range": ",0:0:0-0:0:0",
"value": [
{
"string": "root.layers.x.layers.y"
}
]
}
},
"references": [
{
"string": {
"range": "x.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
},
"key_path": {
"range": "x.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
},
{
"unquoted_string": {
"range": "x.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "x.d2,0:0:0-0:16:16",
"key": {
"range": "x.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
},
{
"unquoted_string": {
"range": "x.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
"string": "root.layers.y"
}
]
}
}
}
}
}
]
}
],
"edges": null
},
"references": [
{
"string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
},
"key_path": {
"range": "x.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
},
{
"unquoted_string": {
"range": "x.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "x.d2,0:0:0-0:16:16",
"key": {
"range": "x.d2,0:0:0-0:6:6",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:0:0-0:1:1",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
},
{
"unquoted_string": {
"range": "x.d2,0:2:2-0:6:6",
"value": [
{
"string": "link",
"raw_string": "link"
}
]
}
}
]
},
"primary": {},
"value": {
"unquoted_string": {
"range": ",0:0:0-0:0:0",
"value": [
{
"string": "root.layers.y"
}
]
}
}
}
}
}
]
},
{
"name": "layers",
"composite": {
"fields": [
{
"name": "y",
"composite": {
"fields": [
{
"name": "meow",
"references": [
{
"string": {
"range": "y.d2,0:0:0-0:4:4",
"value": [
{
"string": "meow",
"raw_string": "meow"
}
]
},
"key_path": {
"range": "y.d2,0:0:0-0:4:4",
"path": [
{
"unquoted_string": {
"range": "y.d2,0:0:0-0:4:4",
"value": [
{
"string": "meow",
"raw_string": "meow"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "y.d2,0:0:0-0:4:4",
"key": {
"range": "y.d2,0:0:0-0:4:4",
"path": [
{
"unquoted_string": {
"range": "y.d2,0:0:0-0:4:4",
"value": [
{
"string": "meow",
"raw_string": "meow"
}
]
}
}
]
},
"primary": {},
"value": {}
}
}
}
]
}
],
"edges": null
},
"references": [
{
"string": {
"range": "x.d2,0:28:28-0:29:29",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
},
"key_path": {
"range": "x.d2,0:28:28-0:29:29",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:28:28-0:29:29",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "x.d2,0:28:28-0:34:34",
"key": {
"range": "x.d2,0:28:28-0:29:29",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:28:28-0:29:29",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
}
]
},
"primary": {},
"value": {
"import": {
"range": "x.d2,0:31:31-0:34:34",
"spread": false,
"pre": "",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:32:32-0:33:33",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
}
]
}
}
}
}
}
]
}
],
"edges": null
},
"references": [
{
"string": {
"range": "x.d2,0:18:18-0:24:24",
"value": [
{
"string": "layers",
"raw_string": "layers"
}
]
},
"key_path": {
"range": "x.d2,0:18:18-0:24:24",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:18:18-0:24:24",
"value": [
{
"string": "layers",
"raw_string": "layers"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "x.d2,0:18:18-0:35:35",
"key": {
"range": "x.d2,0:18:18-0:24:24",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:18:18-0:24:24",
"value": [
{
"string": "layers",
"raw_string": "layers"
}
]
}
}
]
},
"primary": {},
"value": {
"map": {
"range": "x.d2,0:26:26-0:35:35",
"nodes": [
{
"map_key": {
"range": "x.d2,0:28:28-0:34:34",
"key": {
"range": "x.d2,0:28:28-0:29:29",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:28:28-0:29:29",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
}
]
},
"primary": {},
"value": {
"import": {
"range": "x.d2,0:31:31-0:34:34",
"spread": false,
"pre": "",
"path": [
{
"unquoted_string": {
"range": "x.d2,0:32:32-0:33:33",
"value": [
{
"string": "y",
"raw_string": "y"
}
]
}
}
]
}
}
}
}
]
}
}
}
}
}
]
}
],
"edges": null
},
"references": [
{
"string": {
"range": "index.d2,0:28:28-0:29:29",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
},
"key_path": {
"range": "index.d2,0:28:28-0:29:29",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:28:28-0:29:29",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "index.d2,0:28:28-0:34:34",
"key": {
"range": "index.d2,0:28:28-0:29:29",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:28:28-0:29:29",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
},
"primary": {},
"value": {
"import": {
"range": "index.d2,0:31:31-0:34:34",
"spread": false,
"pre": "",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:32:32-0:33:33",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
}
}
}
}
}
]
}
],
"edges": null
},
"references": [
{
"string": {
"range": "index.d2,0:18:18-0:24:24",
"value": [
{
"string": "layers",
"raw_string": "layers"
}
]
},
"key_path": {
"range": "index.d2,0:18:18-0:24:24",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:18:18-0:24:24",
"value": [
{
"string": "layers",
"raw_string": "layers"
}
]
}
}
]
},
"context": {
"edge": null,
"key": {
"range": "index.d2,0:18:18-0:35:35",
"key": {
"range": "index.d2,0:18:18-0:24:24",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:18:18-0:24:24",
"value": [
{
"string": "layers",
"raw_string": "layers"
}
]
}
}
]
},
"primary": {},
"value": {
"map": {
"range": "index.d2,0:26:26-0:35:35",
"nodes": [
{
"map_key": {
"range": "index.d2,0:28:28-0:34:34",
"key": {
"range": "index.d2,0:28:28-0:29:29",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:28:28-0:29:29",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
},
"primary": {},
"value": {
"import": {
"range": "index.d2,0:31:31-0:34:34",
"spread": false,
"pre": "",
"path": [
{
"unquoted_string": {
"range": "index.d2,0:32:32-0:33:33",
"value": [
{
"string": "x",
"raw_string": "x"
}
]
}
}
]
}
}
}
}
]
}
}
}
}
}
]
}
],
"edges": null
}