pr feedback

This commit is contained in:
Alexander Wang 2023-03-02 17:56:32 -08:00
parent e504aca6d0
commit 78e6f3fc06
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
11 changed files with 257 additions and 229 deletions

View file

@ -198,7 +198,7 @@ func (c *compiler) compileField(obj *d2graph.Object, f *d2ir.Field) {
obj.Map = fr.Context.Key.Value.Map
}
}
scopeObjIDA := d2ir.IDA(fr.Context.ScopeMap)
scopeObjIDA := d2ir.BoardIDA(fr.Context.ScopeMap)
scopeObj := obj.Graph.Root.EnsureChildIDVal(scopeObjIDA)
obj.References = append(obj.References, d2graph.Reference{
Key: fr.KeyPath,
@ -436,7 +436,7 @@ func (c *compiler) compileEdge(obj *d2graph.Object, e *d2ir.Edge) {
edge.Attributes.Label.MapKey = e.LastPrimaryKey()
for _, er := range e.References {
scopeObjIDA := d2ir.IDA(er.Context.ScopeMap)
scopeObjIDA := d2ir.BoardIDA(er.Context.ScopeMap)
scopeObj := edge.Src.Graph.Root.EnsureChildIDVal(scopeObjIDA)
edge.References = append(edge.References, d2graph.EdgeReference{
Edge: er.Context.Edge,
@ -735,16 +735,18 @@ func (c *compiler) validateBoardLinks(g *d2graph.Graph) {
continue
}
root := g
for root.Parent != nil {
root = root.Parent
}
if !hasBoard(root, linkKey.IDA()) {
if !hasBoard(g.RootBoard(), linkKey.IDA()) {
c.errorf(obj.Attributes.Link.MapKey, "linked board not found")
continue
}
}
for _, b := range append(append(g.Layers, g.Scenarios...), g.Steps...) {
for _, b := range g.Layers {
c.validateBoardLinks(b)
}
for _, b := range g.Scenarios {
c.validateBoardLinks(b)
}
for _, b := range g.Steps {
c.validateBoardLinks(b)
}
}
@ -752,7 +754,7 @@ func (c *compiler) validateBoardLinks(g *d2graph.Graph) {
func hasBoard(root *d2graph.Graph, ida []string) bool {
for i := 0; i < len(ida); i += 2 {
id := ida[i]
if id == "root" {
if i == 0 && id == "root" {
i--
continue
}
@ -760,24 +762,27 @@ func hasBoard(root *d2graph.Graph, ida []string) bool {
return root.Name == id
}
nextID := ida[i+1]
if id == "layers" {
switch id {
case "layers":
for _, b := range root.Layers {
if b.Name == nextID {
return hasBoard(b, ida[i+1:])
}
}
} else if id == "scenarios" {
case "scenarios":
for _, b := range root.Scenarios {
if b.Name == nextID {
return hasBoard(b, ida[i+1:])
}
}
} else if id == "steps" {
case "steps":
for _, b := range root.Steps {
if b.Name == nextID {
return hasBoard(b, ida[i+1:])
}
}
default:
break
}
}
return false

View file

@ -2052,7 +2052,7 @@ layers: {
scenarios: {
green: {
question.style.fill: green
question.style.fill: green
}
}`,
assertions: func(t *testing.T, g *d2graph.Graph) {
@ -2071,7 +2071,7 @@ scenarios: {
text: `zzz
x.link: layers.x.y
layers: {
x: {
x: {
y
}
}`,
@ -2081,11 +2081,11 @@ layers: {
name: "link-board-nested",
text: `x.link: layers.x.layers.x
layers: {
x: {
x: {
layers: {
x: {
x: {
hello
}
}
}
}
}`,
@ -2099,7 +2099,7 @@ layers: {
y.link: layers.x
}
layers: {
x: {
x: {
yo
}
}`,
@ -2114,10 +2114,10 @@ layers: {
x: {
yo
layers: {
x: {
hello.link: _._.layers.x
hey.link: _
}
x: {
hello.link: _._.layers.x
hey.link: _
}
}
}
}`,
@ -2131,16 +2131,16 @@ layers: {
name: "link-board-underscore-not-found",
text: `x
layers: {
x: {
yo
x: {
yo
layers: {
x: {
hello.link: _._._
}
x: {
hello.link: _._._
}
}
}
}`,
expErr: `d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:5: linked board not found`,
expErr: `d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:9: invalid underscore usage`,
},
}

View file

@ -409,3 +409,11 @@ func KeyPath(kp *d2ast.KeyPath) (ida []string) {
}
return ida
}
func IDA(ida []string) *d2ast.KeyPath {
kp := &d2ast.KeyPath{}
for _, s := range ida {
kp.Path = append(kp.Path, d2ast.MakeValueBox(d2ast.RawString(s, true)).StringBox())
}
return kp
}

View file

@ -56,6 +56,13 @@ func NewGraph() *Graph {
return d
}
func (g *Graph) RootBoard() *Graph {
for g.Parent != nil {
g = g.Parent
}
return g
}
// TODO consider having different Scalar types
// Right now we'll hold any types in Value and just convert, e.g. floats
type Scalar struct {

View file

@ -1,9 +1,8 @@
package d2ir
import (
"strings"
"oss.terrastruct.com/d2/d2ast"
"oss.terrastruct.com/d2/d2format"
"oss.terrastruct.com/d2/d2parser"
)
@ -129,7 +128,7 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext)
}
c.compileMap(f.Map(), refctx.Key.Value.Map)
} else if refctx.Key.Value.ScalarBox().Unbox() != nil {
// If these are boards, we transform into absolute paths
// If the link is a board, we need to transform it into an absolute path.
if f.Name == "link" {
c.compileLink(refctx)
}
@ -147,8 +146,7 @@ func (c *compiler) compileLink(refctx *RefContext) {
return
}
scopeID, _ := d2parser.ParseKey(refctx.ScopeMap.AbsID())
scopeIDA := scopeID.IDA()
scopeIDA := IDA(refctx.ScopeMap)
if len(scopeIDA) == 0 {
return
@ -159,7 +157,7 @@ func (c *compiler) compileLink(refctx *RefContext) {
return
}
// If it doesn't start with one of these reserved words, the link may be a URL or local path or something
// If it doesn't start with one of these reserved words, the link is definitely not a board link.
if linkIDA[0] != "layers" && linkIDA[0] != "scenarios" && linkIDA[0] != "steps" && linkIDA[0] != "_" {
return
}
@ -181,7 +179,7 @@ func (c *compiler) compileLink(refctx *RefContext) {
if len(scopeIDA) < 2 {
// IR compiler only validates bad underscore usage
// The compiler will validate if the target board actually exists
c.errorf(refctx.Key.Key, "linked board not found")
c.errorf(refctx.Key.Key, "invalid underscore usage")
return
}
// pop 2 off path per one underscore
@ -194,7 +192,8 @@ func (c *compiler) compileLink(refctx *RefContext) {
// Create the absolute path by appending scope path with value specified
scopeIDA = append(scopeIDA, linkIDA...)
refctx.Key.Value = d2ast.MakeValueBox(d2ast.RawString(strings.Join(scopeIDA, "."), true))
kp := d2format.IDA(scopeIDA)
refctx.Key.Value = d2ast.MakeValueBox(d2ast.RawString(d2format.Format(kp), true))
}
func (c *compiler) compileEdges(refctx *RefContext) {

View file

@ -221,17 +221,6 @@ func (m *Map) Root() bool {
return f.Root()
}
func (m *Map) AbsID() string {
f, ok := m.parent.(*Field)
if !ok {
return ""
}
if f.parent == nil {
return f.Name
}
return f.parent.(*Map).AbsID() + "." + f.Name
}
func (f *Field) Root() bool {
return f.parent == nil
}
@ -1044,8 +1033,8 @@ func parentPrimaryKey(n Node) *d2ast.Key {
return nil
}
// IDA returns the absolute path to n from the nearest board root.
func IDA(n Node) (ida []string) {
// BoardIDA returns the absolute path to n from the nearest board root.
func BoardIDA(n Node) (ida []string) {
for {
f, ok := n.(*Field)
if ok {
@ -1064,6 +1053,26 @@ func IDA(n Node) (ida []string) {
}
}
// IDA returns the absolute path to n from the nearest board root.
func IDA(n Node) (ida []string) {
for {
f, ok := n.(*Field)
if ok {
ida = append(ida, f.Name)
if f.Root() {
reverseIDA(ida)
return ida
}
}
f = ParentField(n)
if f == nil {
reverseIDA(ida)
return ida
}
n = f
}
}
func reverseIDA(ida []string) {
for i := 0; i < len(ida)/2; i++ {
tmp := ida[i]

View file

@ -3,7 +3,7 @@
"name": "",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,0:0:0-7:1:54",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,0:0:0-7:1:55",
"nodes": [
{
"map_key": {
@ -79,7 +79,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:0:26-7:1:54",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:0:26-7:1:55",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:0:26-3:6:32",
"path": [
@ -99,17 +99,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:8:34-7:0:53",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:8:34-7:0:54",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:1:37-6:3:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:2:38-6:3:53",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:1:37-4:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:2:38-4:3:39",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:1:37-4:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:2:38-4:3:39",
"value": [
{
"string": "x",
@ -123,17 +123,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:4:40-6:2:51",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:5:41-6:2:52",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"value": [
{
"string": "yo",
@ -301,7 +301,7 @@
"name": "x",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,0:0:0-7:1:54",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,0:0:0-7:1:55",
"nodes": [
{
"map_key": {
@ -377,7 +377,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:0:26-7:1:54",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:0:26-7:1:55",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:0:26-3:6:32",
"path": [
@ -397,17 +397,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:8:34-7:0:53",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,3:8:34-7:0:54",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:1:37-6:3:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:2:38-6:3:53",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:1:37-4:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:2:38-4:3:39",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:1:37-4:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:2:38-4:3:39",
"value": [
{
"string": "x",
@ -421,17 +421,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:4:40-6:2:51",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,4:5:41-6:2:52",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"value": [
{
"string": "yo",
@ -495,11 +495,11 @@
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:46-5:6:48",
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,5:4:47-5:6:49",
"value": [
{
"string": "yo",

View file

@ -3,7 +3,7 @@
"name": "",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:0:0-13:1:173",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:0:0-13:1:175",
"nodes": [
{
"map_key": {
@ -197,7 +197,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-13:1:173",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-13:1:175",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-9:9:124",
"path": [
@ -217,11 +217,11 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:11:126-13:0:172",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:11:126-13:0:174",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-12:3:171",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-12:3:173",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-10:7:135",
"path": [
@ -241,17 +241,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:9:137-12:2:170",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:9:137-12:2:172",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:28:167",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:30:169",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:23:162",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:10:149",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:12:151",
"value": [
{
"string": "question",
@ -262,7 +262,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:11:150-11:16:155",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:13:152-11:18:157",
"value": [
{
"string": "style",
@ -273,7 +273,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:17:156-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:19:158-11:23:162",
"value": [
{
"string": "fill",
@ -287,7 +287,7 @@
"primary": {},
"value": {
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:23:162-11:28:167",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:25:164-11:30:169",
"value": [
{
"string": "green",
@ -424,7 +424,7 @@
"name": "cat",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:0:0-13:1:173",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:0:0-13:1:175",
"nodes": [
{
"map_key": {
@ -618,7 +618,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-13:1:173",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-13:1:175",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-9:9:124",
"path": [
@ -638,11 +638,11 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:11:126-13:0:172",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:11:126-13:0:174",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-12:3:171",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-12:3:173",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-10:7:135",
"path": [
@ -662,17 +662,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:9:137-12:2:170",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:9:137-12:2:172",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:28:167",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:30:169",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:23:162",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:10:149",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:12:151",
"value": [
{
"string": "question",
@ -683,7 +683,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:11:150-11:16:155",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:13:152-11:18:157",
"value": [
{
"string": "style",
@ -694,7 +694,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:17:156-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:19:158-11:23:162",
"value": [
{
"string": "fill",
@ -708,7 +708,7 @@
"primary": {},
"value": {
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:23:162-11:28:167",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:25:164-11:30:169",
"value": [
{
"string": "green",
@ -895,7 +895,7 @@
"name": "green",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:0:0-13:1:173",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,0:0:0-13:1:175",
"nodes": [
{
"map_key": {
@ -1089,7 +1089,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-13:1:173",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-13:1:175",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:0:115-9:9:124",
"path": [
@ -1109,11 +1109,11 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:11:126-13:0:172",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,9:11:126-13:0:174",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-12:3:171",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-12:3:173",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:2:130-10:7:135",
"path": [
@ -1133,17 +1133,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:9:137-12:2:170",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,10:9:137-12:2:172",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:28:167",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:30:169",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:23:162",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:10:149",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:12:151",
"value": [
{
"string": "question",
@ -1154,7 +1154,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:11:150-11:16:155",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:13:152-11:18:157",
"value": [
{
"string": "style",
@ -1165,7 +1165,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:17:156-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:19:158-11:23:162",
"value": [
{
"string": "fill",
@ -1179,7 +1179,7 @@
"primary": {},
"value": {
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:23:162-11:28:167",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:25:164-11:30:169",
"value": [
{
"string": "green",
@ -1290,11 +1290,11 @@
},
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:23:162",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:2:141-11:10:149",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:4:143-11:12:151",
"value": [
{
"string": "question",
@ -1305,7 +1305,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:11:150-11:16:155",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:13:152-11:18:157",
"value": [
{
"string": "style",
@ -1316,7 +1316,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:17:156-11:21:160",
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,11:19:158-11:23:162",
"value": [
{
"string": "fill",

View file

@ -3,7 +3,7 @@
"name": "",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-9:1:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-9:1:101",
"nodes": [
{
"map_key": {
@ -50,7 +50,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-9:1:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-9:1:101",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-1:6:32",
"path": [
@ -70,17 +70,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-9:0:93",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-9:0:100",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-8:3:92",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-8:3:99",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-2:3:39",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-2:3:39",
"value": [
{
"string": "x",
@ -94,17 +94,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:4:40-8:2:91",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:5:41-8:2:98",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-7:5:88",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-7:5:95",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-3:10:53",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-3:10:53",
"value": [
{
"string": "layers",
@ -118,17 +118,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:54-7:4:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:55-7:4:94",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-6:4:82",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-6:7:89",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-4:4:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-4:7:64",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-4:4:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-4:7:64",
"value": [
{
"string": "x",
@ -142,17 +142,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-6:3:81",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:9:66-6:6:88",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"value": [
{
"string": "hello",
@ -283,7 +283,7 @@
"name": "x",
"isFolderOnly": true,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-9:1:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-9:1:101",
"nodes": [
{
"map_key": {
@ -330,7 +330,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-9:1:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-9:1:101",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-1:6:32",
"path": [
@ -350,17 +350,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-9:0:93",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-9:0:100",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-8:3:92",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-8:3:99",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-2:3:39",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-2:3:39",
"value": [
{
"string": "x",
@ -374,17 +374,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:4:40-8:2:91",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:5:41-8:2:98",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-7:5:88",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-7:5:95",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-3:10:53",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-3:10:53",
"value": [
{
"string": "layers",
@ -398,17 +398,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:54-7:4:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:55-7:4:94",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-6:4:82",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-6:7:89",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-4:4:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-4:7:64",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-4:4:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-4:7:64",
"value": [
{
"string": "x",
@ -422,17 +422,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-6:3:81",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:9:66-6:6:88",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"value": [
{
"string": "hello",
@ -501,7 +501,7 @@
"name": "x",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-9:1:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-9:1:101",
"nodes": [
{
"map_key": {
@ -548,7 +548,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-9:1:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-9:1:101",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:0:26-1:6:32",
"path": [
@ -568,17 +568,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-9:0:93",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,1:8:34-9:0:100",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-8:3:92",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-8:3:99",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-2:3:39",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:1:37-2:2:38",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:2:38-2:3:39",
"value": [
{
"string": "x",
@ -592,17 +592,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:4:40-8:2:91",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,2:5:41-8:2:98",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-7:5:88",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-7:5:95",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-3:10:53",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:46-3:10:52",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:4:47-3:10:53",
"value": [
{
"string": "layers",
@ -616,17 +616,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:54-7:4:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,3:12:55-7:4:94",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-6:4:82",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-6:7:89",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-4:4:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-4:7:64",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:3:59-4:4:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:63-4:7:64",
"value": [
{
"string": "x",
@ -640,17 +640,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:6:62-6:3:81",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,4:9:66-6:6:88",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"value": [
{
"string": "hello",
@ -724,11 +724,11 @@
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:72-5:13:77",
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,5:8:76-5:13:81",
"value": [
{
"string": "hello",

View file

@ -4,8 +4,8 @@
"ioerr": null,
"errs": [
{
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:4:50-6:14:60",
"errmsg": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:5: linked board not found"
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:8:59-6:18:69",
"errmsg": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:9: invalid underscore usage"
}
]
}

View file

@ -3,7 +3,7 @@
"name": "",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,0:0:0-11:1:107",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,0:0:0-11:1:121",
"nodes": [
{
"map_key": {
@ -30,7 +30,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-11:1:107",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-11:1:121",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-1:6:8",
"path": [
@ -50,11 +50,11 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:8:10-11:0:106",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:8:10-11:0:120",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-10:3:105",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-10:3:119",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-2:2:14",
"path": [
@ -74,7 +74,7 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:4:16-10:2:104",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:4:16-10:2:118",
"nodes": [
{
"map_key": {
@ -101,7 +101,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-9:5:101",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-9:5:115",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-4:10:34",
"path": [
@ -121,17 +121,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:12:36-9:4:100",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:12:36-9:4:114",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-8:4:95",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-8:7:109",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-5:4:42",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-5:7:45",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-5:4:42",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-5:7:45",
"value": [
{
"string": "x",
@ -145,17 +145,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-8:3:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:9:47-8:6:108",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:28:74",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:32:81",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:18:67",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:9:55",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:13:62",
"value": [
{
"string": "hello",
@ -166,7 +166,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:10:56-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:14:63-6:18:67",
"value": [
{
"string": "link",
@ -192,13 +192,13 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:15:90",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:19:101",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:16:98",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:7:82",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:11:93",
"value": [
{
"string": "hey",
@ -209,7 +209,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:83-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:12:94-7:16:98",
"value": [
{
"string": "link",
@ -335,7 +335,7 @@
"name": "x",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,0:0:0-11:1:107",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,0:0:0-11:1:121",
"nodes": [
{
"map_key": {
@ -362,7 +362,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-11:1:107",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-11:1:121",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-1:6:8",
"path": [
@ -382,11 +382,11 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:8:10-11:0:106",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:8:10-11:0:120",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-10:3:105",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-10:3:119",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-2:2:14",
"path": [
@ -406,7 +406,7 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:4:16-10:2:104",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:4:16-10:2:118",
"nodes": [
{
"map_key": {
@ -433,7 +433,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-9:5:101",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-9:5:115",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-4:10:34",
"path": [
@ -453,17 +453,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:12:36-9:4:100",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:12:36-9:4:114",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-8:4:95",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-8:7:109",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-5:4:42",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-5:7:45",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-5:4:42",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-5:7:45",
"value": [
{
"string": "x",
@ -477,17 +477,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-8:3:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:9:47-8:6:108",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:28:74",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:32:81",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:18:67",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:9:55",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:13:62",
"value": [
{
"string": "hello",
@ -498,7 +498,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:10:56-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:14:63-6:18:67",
"value": [
{
"string": "link",
@ -524,13 +524,13 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:15:90",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:19:101",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:16:98",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:7:82",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:11:93",
"value": [
{
"string": "hey",
@ -541,7 +541,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:83-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:12:94-7:16:98",
"value": [
{
"string": "link",
@ -667,7 +667,7 @@
"name": "x",
"isFolderOnly": false,
"ast": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,0:0:0-11:1:107",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,0:0:0-11:1:121",
"nodes": [
{
"map_key": {
@ -694,7 +694,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-11:1:107",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-11:1:121",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:0:2-1:6:8",
"path": [
@ -714,11 +714,11 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:8:10-11:0:106",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,1:8:10-11:0:120",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-10:3:105",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-10:3:119",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:1:13-2:2:14",
"path": [
@ -738,7 +738,7 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:4:16-10:2:104",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,2:4:16-10:2:118",
"nodes": [
{
"map_key": {
@ -765,7 +765,7 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-9:5:101",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-9:5:115",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:4:28-4:10:34",
"path": [
@ -785,17 +785,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:12:36-9:4:100",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,4:12:36-9:4:114",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-8:4:95",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-8:7:109",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-5:4:42",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-5:7:45",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:3:41-5:4:42",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-5:7:45",
"value": [
{
"string": "x",
@ -809,17 +809,17 @@
"primary": {},
"value": {
"map": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:6:44-8:3:94",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,5:9:47-8:6:108",
"nodes": [
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:28:74",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:32:81",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:18:67",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:9:55",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:13:62",
"value": [
{
"string": "hello",
@ -830,7 +830,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:10:56-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:14:63-6:18:67",
"value": [
{
"string": "link",
@ -856,13 +856,13 @@
},
{
"map_key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:15:90",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:19:101",
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:16:98",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:7:82",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:11:93",
"value": [
{
"string": "hey",
@ -873,7 +873,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:83-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:12:94-7:16:98",
"value": [
{
"string": "link",
@ -956,11 +956,11 @@
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:18:67",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:9:55",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:8:57-6:13:62",
"value": [
{
"string": "hello",
@ -971,7 +971,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:10:56-6:14:60",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:14:63-6:18:67",
"value": [
{
"string": "link",
@ -1017,11 +1017,11 @@
"references": [
{
"key": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:16:98",
"path": [
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:7:82",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:90-7:11:93",
"value": [
{
"string": "hey",
@ -1032,7 +1032,7 @@
},
{
"unquoted_string": {
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:8:83-7:12:87",
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:12:94-7:16:98",
"value": [
{
"string": "link",