johnpatrickmorgan / wtfautolayout

The source code for Why The Failure, Auto Layout?
https://www.wtfautolayout.com
MIT License
1.08k stars 22 forks source link

Support leftMargin #5

Closed timothycosta closed 7 years ago

timothycosta commented 7 years ago

Thanks a ton for fixing that issue yesterday! It seems leftMargin and rightMargin are also not supported yet (though I should probably remove those from my own code...):

(
    "<NSLayoutConstraint:0x170490e00 UIScrollView:0x1241d1200.left == LingQ.LQScrollingStackView:0x123ed1070.left>",
    "<NSLayoutConstraint:0x170490ea0 UIScrollView:0x1241d1200.right == LingQ.LQScrollingStackView:0x123ed1070.right>",
    "<SnapKit.LayoutConstraint:0x1706b8600@LLAchievementsCells.swift#222 LingQ.LQScrollingStackView:0x123ed1070.left == NSKVONotifying_LQRoundedCornerView:0x123d8da90.leftMargin>",
    "<SnapKit.LayoutConstraint:0x1706b86c0@LLAchievementsCells.swift#222 LingQ.LQScrollingStackView:0x123ed1070.right == NSKVONotifying_LQRoundedCornerView:0x123d8da90.rightMargin>",
    "<SnapKit.LayoutConstraint:0x1706b9260@LLAchievementsCells.swift#203 UIImageView:0x123d8e1f0.width == NSKVONotifying_LQRoundedCornerView:0x123d8da90.width * 0.25>",
    "<NSLayoutConstraint:0x1742812c0 LingQ.LLBadgeView:0x123d8e020.trailing == _UILayoutSpacer:0x1743a0620.trailing>",
    "<NSLayoutConstraint:0x174281450 LingQ.LLBadgeView:0x123d8e020.centerX == UIImageView:0x123d8e1f0.centerX>",
    "<NSLayoutConstraint:0x1704918f0 LingQ.LLBadgeView:0x123d8e020.width == 0>",
    "<NSLayoutConstraint:0x174281400 _UILayoutSpacer:0x1743a0620.trailing >= UIImageView:0x123d8e1f0.trailing>"
)
UNEXPECTED INPUT:
Line 4, Column 172
    "<SnapKit.LayoutConstraint:0x1706b8600@LLAchievementsCells.swift#222 LingQ.LQScrollingStackView:0x123ed1070.left == NSKVONotifying_LQRoundedCornerView:0x123d8da90.leftMargin>",
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
EXPECTED:
whitespace
digit or whitespace in number
'*' in *
'+' in +
whitespace or '(' in info
'>' in >"
'-' in -
johnpatrickmorgan commented 7 years ago

@timothycosta Thanks for picking this up too! I've now added support for leftMargin, rightMargin and some other margined attribute names. Your input should now parse correctly. 👍