diff --git a/d2compiler/compile.go b/d2compiler/compile.go index df5efd7cd..44a41aa22 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 "top": + case "position-top": _, err := strconv.Atoi(scalar.ScalarString()) if err != nil { - c.errorf(scalar, "non-integer top %#v: %s", scalar.ScalarString(), err) + c.errorf(scalar, "non-integer position-top %#v: %s", scalar.ScalarString(), err) return } attrs.Top = &d2graph.Scalar{} attrs.Top.Value = scalar.ScalarString() attrs.Top.MapKey = f.LastPrimaryKey() - case "left": + case "position-left": _, err := strconv.Atoi(scalar.ScalarString()) if err != nil { - c.errorf(scalar, "non-integer left %#v: %s", scalar.ScalarString(), err) + c.errorf(scalar, "non-integer position-left %#v: %s", scalar.ScalarString(), err) return } attrs.Left = &d2graph.Scalar{} diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 30bdedcbf..4a983d439 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -1433,19 +1433,19 @@ var ReservedKeywords2 map[string]struct{} // Non Style/Holder keywords. var SimpleReservedKeywords = map[string]struct{}{ - "label": {}, - "desc": {}, - "shape": {}, - "icon": {}, - "constraint": {}, - "tooltip": {}, - "link": {}, - "near": {}, - "width": {}, - "height": {}, - "direction": {}, - "top": {}, - "left": {}, + "label": {}, + "desc": {}, + "shape": {}, + "icon": {}, + "constraint": {}, + "tooltip": {}, + "link": {}, + "near": {}, + "width": {}, + "height": {}, + "direction": {}, + "position-top": {}, + "position-left": {}, } // ReservedKeywordHolders are reserved keywords that are meaningless on its own and exist solely to hold a set of reserved keywords