pr feedback

This commit is contained in:
Alexander Wang 2023-03-02 18:25:14 -08:00
parent d8b1e65386
commit 81ce1f8209
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
4 changed files with 3 additions and 12 deletions

View file

@ -781,9 +781,8 @@ func hasBoard(root *d2graph.Graph, ida []string) bool {
return hasBoard(b, ida[i+1:])
}
}
default:
break
}
break
}
return false
}

View file

@ -409,11 +409,3 @@ 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

@ -197,7 +197,7 @@ func (c *compiler) compileLink(refctx *RefContext) {
// Create the absolute path by appending scope path with value specified
scopeIDA = append(scopeIDA, linkIDA...)
kp := d2format.IDA(scopeIDA)
kp := d2ast.MakeKeyPath(scopeIDA)
refctx.Key.Value = d2ast.MakeValueBox(d2ast.RawString(d2format.Format(kp), true))
}

View file

@ -1053,7 +1053,7 @@ func BoardIDA(n Node) (ida []string) {
}
}
// IDA returns the absolute path to n from the nearest board root.
// IDA returns the absolute path to n.
func IDA(n Node) (ida []string) {
for {
f, ok := n.(*Field)