From 315af7a2c26c7f09336b620f4fc2fb9f25989a16 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sat, 18 Feb 2023 16:15:14 -0800 Subject: [PATCH] change --- d2compiler/compile.go | 8 ++++---- d2compiler/compile_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 44a41aa22..5a5ebd3ac 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -285,19 +285,19 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) { attrs.Height = &d2graph.Scalar{} attrs.Height.Value = scalar.ScalarString() attrs.Height.MapKey = f.LastPrimaryKey() - case "position-top": + case "pos-top": _, err := strconv.Atoi(scalar.ScalarString()) if err != nil { - c.errorf(scalar, "non-integer position-top %#v: %s", scalar.ScalarString(), err) + c.errorf(scalar, "non-integer pos-top %#v: %s", scalar.ScalarString(), err) return } attrs.Top = &d2graph.Scalar{} attrs.Top.Value = scalar.ScalarString() attrs.Top.MapKey = f.LastPrimaryKey() - case "position-left": + case "pos-left": _, err := strconv.Atoi(scalar.ScalarString()) if err != nil { - c.errorf(scalar, "non-integer position-left %#v: %s", scalar.ScalarString(), err) + c.errorf(scalar, "non-integer pos-left %#v: %s", scalar.ScalarString(), err) return } attrs.Left = &d2graph.Scalar{} diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 537cec457..c69c03195 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -116,8 +116,8 @@ x: { { name: "positions", text: `hey: { - top: 200 - left: 230 + pos-top: 200 + pos-left: 230 } `, assertions: func(t *testing.T, g *d2graph.Graph) {