<commit_before>//
//  Strutter.swift
//  Strutter
//
//  Created by <NAME> on 10/2/15.
//  Copyright © 2015 pretzlav. All rights reserved.
//

#if os(iOS)
    import UIKit
    typealias ViewClass = UIView
    #else
    import Cocoa
    typealias ViewClass = NSView
#endif

#if OALayout
    import OALayoutAnchor
    public typealias LayoutAnchor = OALayoutAnchor
    public typealias LayoutDimension = OALayoutDimension
    #else
    public typealias LayoutAnchor = NSLayoutAnchor
    public typealias LayoutDimension = NSLayoutDimension
#endif

infix operator |=| { associativity left precedence 90 }
infix operator |>=| { associativity left precedence 80 }
infix operator |<=| { associativity left precedence 80 }

private func install(constraint: NSLayoutConstraint) -> NSLayoutConstraint {
    // Only disable AutoresizineMask on left item, secondItem may need it enabled
    if let v1 = constraint.firstItem as? ViewClass where v1.superview != nil {
        v1.translatesAutoresizingMaskIntoConstraints = false
    }
    activate(constraint)
    return constraint
}

private func activate(constraint: NSLayoutConstraint) {
    #if OALayout
        constraint.oa_active = true
    #else
        constraint.active = true
    #endif
}

/**
 All Strutter's infix operators create and activate constraints between two `NSLayoutAnchor`s.
 Strutter additionally sets `translatesAutoresizingMaskIntoConstraints` to `false` for the
 first item, provided the first item is a view class with a superview. This was chosen
 as it most closely matches the common case of added a subview, and then constraining it
 to its parent view. In that case, ensure the subview is always referenced on the left.
 */


 /**
 Creates and activates a constraint that defines leftAnchor's attribute as equal to rightAnchor's attribute plus a constant offset.<commit_msg>Correct documentation typo preventing first method from being documented<commit_after>//
//  Strutter.swift
//  Strutter
//
//  Created by <NAME> on 10/2/15.
//  Copyright © 2015 pretzlav. All rights reserved.
//

#if os(iOS)
    import UIKit
    typealias ViewClass = UIView
    #else
    import Cocoa
    typealias ViewClass = NSView
#endif

#if OALayout
    import OALayoutAnchor
    public typealias LayoutAnchor = OALayoutAnchor
    public typealias LayoutDimension = OALayoutDimension
    #else
    public typealias LayoutAnchor = NSLayoutAnchor
    public typealias LayoutDimension = NSLayoutDimension
#endif

infix operator |=| { associativity left precedence 90 }
infix operator |>=| { associativity left precedence 80 }
infix operator |<=| { associativity left precedence 80 }

private func install(constraint: NSLayoutConstraint) -> NSLayoutConstraint {
    // Only disable AutoresizineMask on left item, secondItem may need it enabled
    if let v1 = constraint.firstItem as? ViewClass where v1.superview != nil {
        v1.translatesAutoresizingMaskIntoConstraints = false
    }
    activate(constraint)
    return constraint
}

private func activate(constraint: NSLayoutConstraint) {
    #if OALayout
        constraint.oa_active = true
    #else
        constraint.active = true
    #endif
}

/**
 All Strutter's infix operators create and activate constraints between two `NSLayoutAnchor`s.
 Strutter additionally sets `translatesAutoresizingMaskIntoConstraints` to `false` for the
 first item, provided the first item is a view class with a superview. This was chosen
 as it most closely matches the common case of added a subview, and then constraining it
 to its parent view. In that case, ensure the subview is always referenced on the left.
 */


/**
 Creates and activates a constraint that defines leftAnchor's attribute as equal to rightAnchor's attribute plus a constant offset.
{'fraction_non_alphanumeric': 0.06186666666666667, 'fraction_numerical': 0.0096, 'mean_word_length': 3.7844387755102042, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6851081', 'n_tokens_mistral': 1016, 'n_tokens_neox': 971, 'n_words': 399}