<commit_before>//
//  Spec.1.2.1.swift
//  MKHProjGen
//
//  Created by <NAME> on 3/17/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation

//===

enum Spec_1_2_1
{
    static
    func generate(for p: Project) -> RawSpec
    {
        var result: RawSpec = []
        var idention: Int = 0
        
        //===
        
        result <<< (idention, "# generated with MKHProjGen")
        result <<< (idention, "# https://github.com/maximkhatskevich/MKHProjGen")
        
        //===
        
        // https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#version-number
        
        result <<< (idention, Spec.key("version") + " 1.2.1")
        
        //===
        
        result <<< process(&idention, p.configurations)
        
        //===
        
        result <<< process(&idention, p.targets)
        
        //===
        
        result <<< (idention, Spec.key("variants"))
        
        idention += 1
        
        result <<< (idention, Spec.key("$base"))
        
        idention += 1
        
        result <<< (idention, Spec.key("abstract") + " true")
        
        idention -= 1
        
        result <<< (idention, Spec.key(p.name))
        
        idention -= 1
        
        //===
        
        return result
    }
    
    //===
    
    static
    func process(
        _ idention: inout Int,
        _ set: Project.BuildConfigurations
        ) -> RawSpec
    {
        // https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
        
        //===<commit_msg>Empty line at the EOF<commit_after>//
//  Spec.1.2.1.swift
//  MKHProjGen
//
//  Created by <NAME> on 3/17/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import Foundation

//===

enum Spec_1_2_1
{
    static
    func generate(for p: Project) -> RawSpec
    {
        var result: RawSpec = []
        var idention: Int = 0
        
        //===
        
        result <<< (idention, "# generated with MKHProjGen")
        result <<< (idention, "# https://github.com/maximkhatskevich/MKHProjGen")
        
        //===
        
        // https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#version-number
        
        result <<< (idention, Spec.key("version") + " 1.2.1")
        
        //===
        
        result <<< process(&idention, p.configurations)
        
        //===
        
        result <<< process(&idention, p.targets)
        
        //===
        
        result <<< (idention, Spec.key("variants"))
        
        idention += 1
        
        result <<< (idention, Spec.key("$base"))
        
        idention += 1
        
        result <<< (idention, Spec.key("abstract") + " true")
        
        idention -= 1
        
        result <<< (idention, Spec.key(p.name))
        
        idention -= 1
        
        //===
        
        result <<< (0, "") // empty line in the EOF
        
        //===
        
        return result
    }
    
    //===
    
    static
    func process(
        _ idention: inout Int,
        _ set: Project.BuildConfigurations
        ) -> RawSpec
    {
        // https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
        
        //===
{'fraction_non_alphanumeric': 0.15463596764156815, 'fraction_numerical': 0.017112632233976355, 'mean_word_length': 1.2769121813031161, 'pattern_counts': {'":': 0, '<': 64, '<?xml version=': 0, '>': 11, 'https://': 6, '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': '4851293', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1007, 'n_words': 179}