d2ir: Review fixes #714
This commit is contained in:
parent
dffcb274cd
commit
dce4385644
8 changed files with 2704 additions and 44 deletions
|
|
@ -61,7 +61,6 @@ func (c *compiler) compileSteps(m *Map) {
|
||||||
if sf.Map() == nil {
|
if sf.Map() == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
var base *Map
|
var base *Map
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
base = m.CopyBase(sf)
|
base = m.CopyBase(sf)
|
||||||
|
|
@ -243,7 +242,7 @@ func (c *compiler) compileArray(dst *Array, a *d2ast.Array) {
|
||||||
Value: v,
|
Value: v,
|
||||||
}
|
}
|
||||||
case *d2ast.Substitution:
|
case *d2ast.Substitution:
|
||||||
panic("TODO")
|
// panic("TODO")
|
||||||
}
|
}
|
||||||
|
|
||||||
dst.Values = append(dst.Values, irv)
|
dst.Values = append(dst.Values, irv)
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,8 @@ type Field struct {
|
||||||
|
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// Primary_ to avoid clashing with Primary(). We need to keep it exported for
|
||||||
|
// encoding/json to marshal it so cannot prefix _ instead.
|
||||||
Primary_ *Scalar `json:"primary,omitempty"`
|
Primary_ *Scalar `json:"primary,omitempty"`
|
||||||
Composite Composite `json:"composite,omitempty"`
|
Composite Composite `json:"composite,omitempty"`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1877,6 +1877,62 @@ a.sp1 -> a.sp2: redirect
|
||||||
a.sp2 -> b: bar
|
a.sp2 -> b: bar
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "complex-layers",
|
||||||
|
script: `
|
||||||
|
desc: Multi-layer diagram of a home.
|
||||||
|
|
||||||
|
window: {
|
||||||
|
style.double-border: true
|
||||||
|
}
|
||||||
|
roof
|
||||||
|
garage
|
||||||
|
|
||||||
|
layers: {
|
||||||
|
window: {
|
||||||
|
blinds
|
||||||
|
glass
|
||||||
|
}
|
||||||
|
roof: {
|
||||||
|
shingles
|
||||||
|
starlink
|
||||||
|
utility hookup
|
||||||
|
}
|
||||||
|
garage: {
|
||||||
|
tools
|
||||||
|
vehicles
|
||||||
|
}
|
||||||
|
repair: {
|
||||||
|
desc: How to repair a home.
|
||||||
|
|
||||||
|
steps: {
|
||||||
|
1: {
|
||||||
|
find contractors: {
|
||||||
|
craigslist
|
||||||
|
facebook
|
||||||
|
}
|
||||||
|
}
|
||||||
|
2: {
|
||||||
|
find contractors -> solicit quotes
|
||||||
|
}
|
||||||
|
3: {
|
||||||
|
obtain quotes -> negotiate
|
||||||
|
}
|
||||||
|
4: {
|
||||||
|
negotiate -> book the best bid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scenarios: {
|
||||||
|
storm: {
|
||||||
|
water
|
||||||
|
rain
|
||||||
|
thunder
|
||||||
|
}
|
||||||
|
}`,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
runa(t, tcs)
|
runa(t, tcs)
|
||||||
|
|
|
||||||
1284
e2etests/testdata/stable/complex-layers/dagre/board.exp.json
generated
vendored
Normal file
1284
e2etests/testdata/stable/complex-layers/dagre/board.exp.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
52
e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg
vendored
Normal file
52
e2etests/testdata/stable/complex-layers/dagre/sketch.exp.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 325 KiB |
1257
e2etests/testdata/stable/complex-layers/elk/board.exp.json
generated
vendored
Normal file
1257
e2etests/testdata/stable/complex-layers/elk/board.exp.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
52
e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg
vendored
Normal file
52
e2etests/testdata/stable/complex-layers/elk/sketch.exp.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 325 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 652 KiB |
Loading…
Reference in a new issue