ok
This commit is contained in:
parent
3a9745974c
commit
85985bbaf5
14 changed files with 100 additions and 91 deletions
|
|
@ -327,8 +327,6 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) {
|
||||||
attrs.Link = &d2graph.Scalar{}
|
attrs.Link = &d2graph.Scalar{}
|
||||||
attrs.Link.Value = scalar.ScalarString()
|
attrs.Link.Value = scalar.ScalarString()
|
||||||
attrs.Link.MapKey = f.LastPrimaryKey()
|
attrs.Link.MapKey = f.LastPrimaryKey()
|
||||||
// TODO I think all the attributes need the range actually
|
|
||||||
attrs.Link.MapKey.Range = scalar.GetRange()
|
|
||||||
case "direction":
|
case "direction":
|
||||||
dirs := []string{"up", "down", "right", "left"}
|
dirs := []string{"up", "down", "right", "left"}
|
||||||
if !go2.Contains(dirs, scalar.ScalarString()) {
|
if !go2.Contains(dirs, scalar.ScalarString()) {
|
||||||
|
|
@ -729,7 +727,6 @@ func (c *compiler) validateBoardLinks(g *d2graph.Graph) {
|
||||||
}
|
}
|
||||||
|
|
||||||
linkKey, err := d2parser.ParseKey(obj.Attributes.Link.Value)
|
linkKey, err := d2parser.ParseKey(obj.Attributes.Link.Value)
|
||||||
// Links can be urls
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
@ -743,7 +740,7 @@ func (c *compiler) validateBoardLinks(g *d2graph.Graph) {
|
||||||
root = root.Parent
|
root = root.Parent
|
||||||
}
|
}
|
||||||
if !hasBoard(root, linkKey.IDA()) {
|
if !hasBoard(root, linkKey.IDA()) {
|
||||||
c.errorf(obj.Attributes.Link.MapKey, "link key to board not found")
|
c.errorf(obj.Attributes.Link.MapKey, "linked board not found")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -756,6 +753,7 @@ func hasBoard(root *d2graph.Graph, ida []string) bool {
|
||||||
for i := 0; i < len(ida); i += 2 {
|
for i := 0; i < len(ida); i += 2 {
|
||||||
id := ida[i]
|
id := ida[i]
|
||||||
if id == "root" {
|
if id == "root" {
|
||||||
|
i--
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if i == len(ida)-1 {
|
if i == len(ida)-1 {
|
||||||
|
|
@ -765,19 +763,19 @@ func hasBoard(root *d2graph.Graph, ida []string) bool {
|
||||||
if id == "layers" {
|
if id == "layers" {
|
||||||
for _, b := range root.Layers {
|
for _, b := range root.Layers {
|
||||||
if b.Name == nextID {
|
if b.Name == nextID {
|
||||||
return hasBoard(b, ida[i:])
|
return hasBoard(b, ida[i+1:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if id == "scenarios" {
|
} else if id == "scenarios" {
|
||||||
for _, b := range root.Scenarios {
|
for _, b := range root.Scenarios {
|
||||||
if b.Name == nextID {
|
if b.Name == nextID {
|
||||||
return hasBoard(b, ida[i:])
|
return hasBoard(b, ida[i+1:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if id == "steps" {
|
} else if id == "steps" {
|
||||||
for _, b := range root.Steps {
|
for _, b := range root.Steps {
|
||||||
if b.Name == nextID {
|
if b.Name == nextID {
|
||||||
return hasBoard(b, ida[i:])
|
return hasBoard(b, ida[i+1:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2063,7 +2063,7 @@ scenarios: {
|
||||||
name: "link-board-not-found",
|
name: "link-board-not-found",
|
||||||
text: `x.link: layers.x
|
text: `x.link: layers.x
|
||||||
`,
|
`,
|
||||||
expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:9: link key "layers.x" to board not found`,
|
expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:1: linked board not found`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "link-board-not-board",
|
name: "link-board-not-board",
|
||||||
|
|
@ -2074,7 +2074,7 @@ layers: {
|
||||||
y
|
y
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:9: link key "layers.x.y" to board not found`,
|
expErr: `d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:1: linked board not found`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "link-board-nested",
|
name: "link-board-nested",
|
||||||
|
|
@ -2139,7 +2139,7 @@ layers: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
expErr: `d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:5: board referenced by link not found`,
|
expErr: `d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:5: linked board not found`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,28 +56,6 @@ func NewGraph() *Graph {
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Graph) AbsID() string {
|
|
||||||
if g.Parent == nil {
|
|
||||||
return g.Name
|
|
||||||
}
|
|
||||||
for _, l := range g.Parent.Layers {
|
|
||||||
if l.Name == g.Name {
|
|
||||||
return g.Parent.AbsID() + ".layers." + g.Name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for _, s := range g.Parent.Scenarios {
|
|
||||||
if s.Name == g.Name {
|
|
||||||
return g.Parent.AbsID() + ".scenarios." + g.Name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for _, s := range g.Parent.Steps {
|
|
||||||
if s.Name == g.Name {
|
|
||||||
return g.Parent.AbsID() + ".steps." + g.Name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO consider having different Scalar types
|
// TODO consider having different Scalar types
|
||||||
// Right now we'll hold any types in Value and just convert, e.g. floats
|
// Right now we'll hold any types in Value and just convert, e.g. floats
|
||||||
type Scalar struct {
|
type Scalar struct {
|
||||||
|
|
|
||||||
|
|
@ -131,31 +131,7 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext)
|
||||||
} else if refctx.Key.Value.ScalarBox().Unbox() != nil {
|
} else if refctx.Key.Value.ScalarBox().Unbox() != nil {
|
||||||
// If these are boards, we transform into absolute paths
|
// If these are boards, we transform into absolute paths
|
||||||
if f.Name == "link" {
|
if f.Name == "link" {
|
||||||
link, err := d2parser.ParseKey(refctx.Key.Value.ScalarBox().Unbox().ScalarString())
|
c.compileLink(refctx)
|
||||||
if err == nil {
|
|
||||||
scopeID, _ := d2parser.ParseKey(refctx.ScopeMap.AbsID())
|
|
||||||
scopeIDA := scopeID.IDA()
|
|
||||||
for i := len(scopeIDA) - 1; i > 0; i-- {
|
|
||||||
if scopeIDA[i-1] == "layers" || scopeIDA[i-1] == "scenarios" || scopeIDA[i-1] == "steps" || scopeIDA[i-1] == "root" {
|
|
||||||
scopeIDA = scopeIDA[:i+1]
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
linkIDA := link.IDA()
|
|
||||||
if len(linkIDA) > 0 {
|
|
||||||
for len(linkIDA) > 0 && linkIDA[0] == "_" {
|
|
||||||
if len(scopeIDA) <= 2 {
|
|
||||||
c.errorf(refctx.Key.Key, "board referenced by link not found")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// pop 2 off path per one underscore
|
|
||||||
scopeIDA = scopeIDA[:len(scopeIDA)-2]
|
|
||||||
linkIDA = linkIDA[1:]
|
|
||||||
}
|
|
||||||
scopeIDA = append(scopeIDA, linkIDA...)
|
|
||||||
refctx.Key.Value = d2ast.MakeValueBox(d2ast.RawString(strings.Join(scopeIDA, "."), true))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
f.Primary_ = &Scalar{
|
f.Primary_ = &Scalar{
|
||||||
parent: f,
|
parent: f,
|
||||||
|
|
@ -164,6 +140,61 @@ func (c *compiler) compileField(dst *Map, kp *d2ast.KeyPath, refctx *RefContext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *compiler) compileLink(refctx *RefContext) {
|
||||||
|
val := refctx.Key.Value.ScalarBox().Unbox().ScalarString()
|
||||||
|
link, err := d2parser.ParseKey(val)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
scopeID, _ := d2parser.ParseKey(refctx.ScopeMap.AbsID())
|
||||||
|
scopeIDA := scopeID.IDA()
|
||||||
|
|
||||||
|
if len(scopeIDA) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
linkIDA := link.IDA()
|
||||||
|
if len(linkIDA) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it doesn't start with one of these reserved words, the link may be a URL or local path or something
|
||||||
|
if linkIDA[0] != "layers" && linkIDA[0] != "scenarios" && linkIDA[0] != "steps" && linkIDA[0] != "_" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Chop off the non-board portion of the scope, like if this is being defined on a nested object (e.g. `x.y.z`)
|
||||||
|
for i := len(scopeIDA) - 1; i > 0; i-- {
|
||||||
|
if scopeIDA[i-1] == "layers" || scopeIDA[i-1] == "scenarios" || scopeIDA[i-1] == "steps" {
|
||||||
|
scopeIDA = scopeIDA[:i+1]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if scopeIDA[i-1] == "root" {
|
||||||
|
scopeIDA = scopeIDA[:i]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve underscores
|
||||||
|
for len(linkIDA) > 0 && linkIDA[0] == "_" {
|
||||||
|
if len(scopeIDA) < 2 {
|
||||||
|
c.errorf(refctx.Key.Key, "linked board not found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// pop 2 off path per one underscore
|
||||||
|
scopeIDA = scopeIDA[:len(scopeIDA)-2]
|
||||||
|
linkIDA = linkIDA[1:]
|
||||||
|
}
|
||||||
|
if len(scopeIDA) == 0 {
|
||||||
|
scopeIDA = []string{"root"}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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))
|
||||||
|
}
|
||||||
|
|
||||||
func (c *compiler) compileEdges(refctx *RefContext) {
|
func (c *compiler) compileEdges(refctx *RefContext) {
|
||||||
if refctx.Key.Key != nil {
|
if refctx.Key.Key != nil {
|
||||||
f, err := refctx.ScopeMap.EnsureField(refctx.Key.Key, refctx)
|
f, err := refctx.ScopeMap.EnsureField(refctx.Key.Key, refctx)
|
||||||
|
|
|
||||||
10
testdata/d2compiler/TestCompile/link-board-key-nested.exp.json
generated
vendored
10
testdata/d2compiler/TestCompile/link-board-key-nested.exp.json
generated
vendored
|
|
@ -31,7 +31,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,1:2:7-1:18:23",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,1:2:7-1:8:13",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,1:2:7-1:8:13",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": ",0:0:0-0:0:0",
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "root.x.layers.x"
|
"string": "root.layers.x"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -280,7 +280,7 @@
|
||||||
},
|
},
|
||||||
"style": {},
|
"style": {},
|
||||||
"link": {
|
"link": {
|
||||||
"value": "root.x.layers.x"
|
"value": "root.layers.x"
|
||||||
},
|
},
|
||||||
"near_key": null,
|
"near_key": null,
|
||||||
"shape": {
|
"shape": {
|
||||||
|
|
@ -329,7 +329,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,1:2:7-1:18:23",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,1:2:7-1:8:13",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-key-nested.d2,1:2:7-1:8:13",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -363,7 +363,7 @@
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": ",0:0:0-0:0:0",
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "root.x.layers.x"
|
"string": "root.layers.x"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
testdata/d2compiler/TestCompile/link-board-mixed.exp.json
generated
vendored
6
testdata/d2compiler/TestCompile/link-board-mixed.exp.json
generated
vendored
|
|
@ -40,7 +40,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:25:56",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:13:44",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:13:44",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -461,7 +461,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:25:56",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:13:44",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:13:44",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -932,7 +932,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:25:56",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:13:44",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-mixed.d2,1:0:31-1:13:44",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
|
||||||
6
testdata/d2compiler/TestCompile/link-board-nested.exp.json
generated
vendored
6
testdata/d2compiler/TestCompile/link-board-nested.exp.json
generated
vendored
|
|
@ -7,7 +7,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:25:25",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -287,7 +287,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:25:25",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -505,7 +505,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:25:25",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-nested.d2,0:0:0-0:6:6",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
|
||||||
4
testdata/d2compiler/TestCompile/link-board-not-board.exp.json
generated
vendored
4
testdata/d2compiler/TestCompile/link-board-not-board.exp.json
generated
vendored
|
|
@ -4,8 +4,8 @@
|
||||||
"ioerr": null,
|
"ioerr": null,
|
||||||
"errs": [
|
"errs": [
|
||||||
{
|
{
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:8:12-1:18:22",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2,1:0:4-1:18:22",
|
||||||
"errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:9: link key \"layers.x.y\" to board not found"
|
"errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-board.d2:2:1: linked board not found"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
testdata/d2compiler/TestCompile/link-board-not-found.exp.json
generated
vendored
4
testdata/d2compiler/TestCompile/link-board-not-found.exp.json
generated
vendored
|
|
@ -4,8 +4,8 @@
|
||||||
"ioerr": null,
|
"ioerr": null,
|
||||||
"errs": [
|
"errs": [
|
||||||
{
|
{
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:8:8-0:16:16",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2,0:0:0-0:16:16",
|
||||||
"errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:9: link key \"layers.x\" to board not found"
|
"errmsg": "d2/testdata/d2compiler/TestCompile/link-board-not-found.d2:1:1: linked board not found"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
testdata/d2compiler/TestCompile/link-board-ok.exp.json
generated
vendored
4
testdata/d2compiler/TestCompile/link-board-ok.exp.json
generated
vendored
|
|
@ -7,7 +7,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:16:16",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:6:6",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:6:6",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -229,7 +229,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:16:16",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:6:6",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-ok.d2,0:0:0-0:6:6",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
|
||||||
2
testdata/d2compiler/TestCompile/link-board-underscore-not-found.exp.json
generated
vendored
2
testdata/d2compiler/TestCompile/link-board-underscore-not-found.exp.json
generated
vendored
|
|
@ -5,7 +5,7 @@
|
||||||
"errs": [
|
"errs": [
|
||||||
{
|
{
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2,6:4:50-6:14:60",
|
"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: board referenced by link not found"
|
"errmsg": "d2/testdata/d2compiler/TestCompile/link-board-underscore-not-found.d2:7:5: linked board not found"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
testdata/d2compiler/TestCompile/link-board-underscore.exp.json
generated
vendored
12
testdata/d2compiler/TestCompile/link-board-underscore.exp.json
generated
vendored
|
|
@ -149,7 +149,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:28:74",
|
||||||
"key": {
|
"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:4:50-6:14:60",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -192,7 +192,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:15:90",
|
||||||
"key": {
|
"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:4:79-7:12:87",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -481,7 +481,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:28:74",
|
||||||
"key": {
|
"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:4:50-6:14:60",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -524,7 +524,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:15:90",
|
||||||
"key": {
|
"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:4:79-7:12:87",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -813,7 +813,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,6:4:50-6:28:74",
|
||||||
"key": {
|
"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:4:50-6:14:60",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -856,7 +856,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/link-board-underscore.d2,7:4:79-7:15:90",
|
||||||
"key": {
|
"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:4:79-7:12:87",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
|
||||||
11
testdata/d2compiler/TestCompile/path_link.exp.json
generated
vendored
11
testdata/d2compiler/TestCompile/path_link.exp.json
generated
vendored
|
|
@ -31,7 +31,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:2:7-1:39:44",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:2:7-1:6:11",
|
"range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:2:7-1:6:11",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -50,11 +50,12 @@
|
||||||
},
|
},
|
||||||
"primary": {},
|
"primary": {},
|
||||||
"value": {
|
"value": {
|
||||||
"double_quoted_string": {
|
"unquoted_string": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/path_link.d2,1:8:13-1:39:44",
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "root.x.Overview.Untitled board 7.zzzzz"
|
"string": "Overview.Untitled board 7.zzzzz",
|
||||||
|
"raw_string": "Overview.Untitled board 7.zzzzz"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -130,7 +131,7 @@
|
||||||
},
|
},
|
||||||
"style": {},
|
"style": {},
|
||||||
"link": {
|
"link": {
|
||||||
"value": "root.x.Overview.Untitled board 7.zzzzz"
|
"value": "Overview.Untitled board 7.zzzzz"
|
||||||
},
|
},
|
||||||
"near_key": null,
|
"near_key": null,
|
||||||
"shape": {
|
"shape": {
|
||||||
|
|
|
||||||
11
testdata/d2compiler/TestCompile/url_link.exp.json
generated
vendored
11
testdata/d2compiler/TestCompile/url_link.exp.json
generated
vendored
|
|
@ -31,7 +31,7 @@
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"map_key": {
|
"map_key": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:2:7-1:26:31",
|
||||||
"key": {
|
"key": {
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:2:7-1:6:11",
|
"range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:2:7-1:6:11",
|
||||||
"path": [
|
"path": [
|
||||||
|
|
@ -50,11 +50,12 @@
|
||||||
},
|
},
|
||||||
"primary": {},
|
"primary": {},
|
||||||
"value": {
|
"value": {
|
||||||
"double_quoted_string": {
|
"unquoted_string": {
|
||||||
"range": ",0:0:0-0:0:0",
|
"range": "d2/testdata/d2compiler/TestCompile/url_link.d2,1:8:13-1:26:31",
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
"string": "root.x.https"
|
"string": "https://google.com",
|
||||||
|
"raw_string": "https://google.com"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -130,7 +131,7 @@
|
||||||
},
|
},
|
||||||
"style": {},
|
"style": {},
|
||||||
"link": {
|
"link": {
|
||||||
"value": "root.x.https"
|
"value": "https://google.com"
|
||||||
},
|
},
|
||||||
"near_key": null,
|
"near_key": null,
|
||||||
"shape": {
|
"shape": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue