fix format
This commit is contained in:
parent
655f103697
commit
0b62ea83df
2 changed files with 27 additions and 0 deletions
|
|
@ -358,6 +358,9 @@ func (p *printer) _map(m *d2ast.Map) {
|
||||||
func (p *printer) mapKey(mk *d2ast.Key) {
|
func (p *printer) mapKey(mk *d2ast.Key) {
|
||||||
if mk.Ampersand {
|
if mk.Ampersand {
|
||||||
p.sb.WriteByte('&')
|
p.sb.WriteByte('&')
|
||||||
|
} else if mk.NotAmpersand {
|
||||||
|
p.sb.WriteByte('!')
|
||||||
|
p.sb.WriteByte('&')
|
||||||
}
|
}
|
||||||
if mk.Key != nil {
|
if mk.Key != nil {
|
||||||
p.key(mk.Key)
|
p.key(mk.Key)
|
||||||
|
|
|
||||||
|
|
@ -829,6 +829,30 @@ mybox: {
|
||||||
mybox: {
|
mybox: {
|
||||||
label: prefix${test}suffix
|
label: prefix${test}suffix
|
||||||
}
|
}
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "not-filter",
|
||||||
|
in: `jacob: {
|
||||||
|
shape: circle
|
||||||
|
}
|
||||||
|
jeremy: {
|
||||||
|
shape: rectangle
|
||||||
|
}
|
||||||
|
*: {
|
||||||
|
!&shape: rectangle
|
||||||
|
label: I'm not a rectangle
|
||||||
|
}`,
|
||||||
|
exp: `jacob: {
|
||||||
|
shape: circle
|
||||||
|
}
|
||||||
|
jeremy: {
|
||||||
|
shape: rectangle
|
||||||
|
}
|
||||||
|
*: {
|
||||||
|
!&shape: rectangle
|
||||||
|
label: I'm not a rectangle
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue