fix format

This commit is contained in:
Alexander Wang 2024-07-18 13:11:43 -06:00
parent 655f103697
commit 0b62ea83df
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
2 changed files with 27 additions and 0 deletions

View file

@ -358,6 +358,9 @@ func (p *printer) _map(m *d2ast.Map) {
func (p *printer) mapKey(mk *d2ast.Key) {
if mk.Ampersand {
p.sb.WriteByte('&')
} else if mk.NotAmpersand {
p.sb.WriteByte('!')
p.sb.WriteByte('&')
}
if mk.Key != nil {
p.key(mk.Key)

View file

@ -829,6 +829,30 @@ mybox: {
mybox: {
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
}
`,
},
}