<commit_before>//
// NSScanner+Swift.swift
//
// Copyright (c) 2015 <NAME>
//
// Licensed under the MIT license. For full copyright and license information,
// please see the LICENSE file.
//

import Foundation

extension NSScanner {
    func scanInt32() -> Int32? {
        var result: Int32 = 0
        return scanInt(&result) ? result : nil
    }
    
    func scanInt() -> Int? {
        var result: Int = 0
        return scanInteger(&result) ? result : nil
    }
    
    func scanInt64() -> Int64? {
        var result: Int64 = 0
        return scanLongLong(&result) ? result : nil
    }
    
    func scanUInt64() -> UInt64? {
        var result: UInt64 = 0
        return scanUnsignedLongLong(&result) ? result : nil
    }
    
    func scanFloat() -> Float? {
        var result: Float = 0.0
        return scanFloat(&result) ? result : nil
    }
    
    func scanDouble() -> Double? {
        var result: Double = 0.0
        return scanDouble(&result) ? result : nil
    }
    
    func scanHexUInt32() -> UInt32? {
        var result: UInt32 = 0
        return scanHexInt(&result) ? result : nil
    }
    
    func scanHexUInt64() -> UInt64? {
        var result: UInt64 = 0
        return scanHexLongLong(&result) ? result : nil
    }
    
    func scanHexFloat() -> Float? {
        var result: Float = 0.0
        return scanHexFloat(&result) ? result : nil
    }
    
    func scanHexDouble() -> Double? {
        var result: Double = 0.0
        return scanHexDouble(&result) ? result : nil
    }
    
    func scanString(string: String) -> String? {
        var result: NSString? = nil
        if scanString(string, intoString: &result) {
            return result as? String
        }
        return nil
    }
    
    func scanCharactersFromSet(set: NSCharacterSet) -> String? {
        var result: NSString? = nil
        if scanCharactersFromSet(set, intoString: &result) {
            return result as? String
        }
        return nil
    }
    
    func scanUpToString(string: String) -> String? {
        var result: NSString? = nil
        if scanUpToString(string, intoString: &result) {
            return result as? String
        }
        return nil
    }
    
    func scanUpToCharactersFromSet(set: NSCharacterSet) -> String? {
        var result: NSString? = nil
        if scanUpToCharactersFromSet(set, intoString: &result) {
            return result as? String
        }
        return nil
    }
}<commit_msg>Add 'skip' family of functions to NSScanner<commit_after>//
// NSScanner+Swift.swift
//
// Copyright (c) 2015 <NAME>
//
// Licensed under the MIT license. For full copyright and license information,
// please see the LICENSE file.
//

import Foundation

extension NSScanner {
    func scanInt32() -> Int32? {
        var result: Int32 = 0
        return scanInt(&result) ? result : nil
    }
    
    func skipInt32() -> Bool {
        return scanInt(nil)
    }
    
    func scanInt() -> Int? {
        var result: Int = 0
        return scanInteger(&result) ? result : nil
    }
    
    func skipInt() -> Bool {
        return scanInteger(nil)
    }
    
    func scanInt64() -> Int64? {
        var result: Int64 = 0
        return scanLongLong(&result) ? result : nil
    }
    
    func skipInt64() -> Bool {
        return scanLongLong(nil)
    }
    
    func scanUInt64() -> UInt64? {
        var result: UInt64 = 0
        return scanUnsignedLongLong(&result) ? result : nil
    }
    
    func skipUInt64() -> Bool {
        return scanUnsignedLongLong(nil)
    }
    
    func scanFloat() -> Float? {
        var result: Float = 0.0
        return scanFloat(&result) ? result : nil
    }
    
    func skipFloat() -> Bool {
        return scanFloat(nil)
    }
    
    func scanDouble() -> Double? {
        var result: Double = 0.0
        return scanDouble(&result) ? result : nil
    }
    
    func skipDouble() -> Bool {
        return scanDouble(nil)
    }
    
    func scanHexUInt32() -> UInt32? {
        var result: UInt32 = 0
        return scanHexInt(&result) ? result : nil
    }
    
    func skipHexUInt32() -> Bool {
        return scanHexInt(nil)
    }
    
    func scanHexUInt64() -> UInt64? {
        var result: UInt64 = 0
        return scanHexLongLong(&result) ? result : nil
    }
    
    func skipHexUInt64() -> Bool {
        return scanHexLongLong(nil)
    }
    
    func scanHexFloat() -> Float? {
        var result: Float = 0.0
        return scanHexFloat(&result) ? result : nil
    }
    
    func skipHexFloat() -> Bool {
        return scanHexFloat(nil)
    }
    
    func scanHexDouble() -> Double? {
        var result: Double = 0.0
        return scanHexDouble(&result) ? result : nil
    }
    
    func skipHexDouble() -> Bool {
        return scanHexDouble(nil)
    }
    
    func scanString(string: String) -> String? {
        var result: NSString? = nil
        if scanString(string, intoString: &result) {
            return result as? String
        }
        return nil
    }
    
    func skipString(string: String) -> Bool {
        return scanString(string, intoString: nil)
    }
    
    func scanCharactersFromSet(set: NSCharacterSet) -> String? {
        var result: NSString? = nil
        if scanCharactersFromSet(set, intoString: &result) {
            return result as? String
        }
        return nil
    }
    
    func skipCharactersFromSet(set: NSCharacterSet) -> Bool {
        return scanCharactersFromSet(set, intoString: nil)
    }
    
    func scanUpToString(string: String) -> String? {
        var result: NSString? = nil
        if scanUpToString(string, intoString: &result) {
            return result as? String
        }
        return nil
    }
    
    func skipUpToString(string: String) -> Bool {
        return scanUpToString(string, intoString: nil)
    }
    
    func scanUpToCharactersFromSet(set: NSCharacterSet) -> String? {
        var result: NSString? = nil
        if scanUpToCharactersFromSet(set, intoString: &result) {
            return result as? String
        }
        return nil
    }
    
    func skipUpToCharactersFromSet(set: NSCharacterSet) -> Bool {
        return scanUpToCharactersFromSet(set, intoString: nil)
    }
}
{'fraction_non_alphanumeric': 0.101000322684737, 'fraction_numerical': 0.017102291061632784, 'mean_word_length': 1.892673821745217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, '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': '4426151', 'n_tokens_mistral': 1909, 'n_tokens_neox': 1818, 'n_words': 504}