<commit_before>﻿module BABYLON {
    // Adds the parsers to the scene parsers.
    AbstractScene.AddParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {
        // Particles Systems
        if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {
            for (var index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {
                var parsedParticleSystem = parsedData.particleSystems[index];

                if (parsedParticleSystem.activeParticleCount) {
                    let ps = GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
                    container.particleSystems.push(ps);
                } else {
                    let ps = ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
                    container.particleSystems.push(ps);
                }
            }
        }
    });

    AbstractScene.AddIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedParticleSystem: any, scene: Scene, rootUrl: string) => {
        if (parsedParticleSystem.activeParticleCount) {
            let ps = GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
            return ps;
        } else {
            let ps = ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
            return ps;
        }
    });<commit_msg>reuse parser<commit_after>﻿module BABYLON {
    // Adds the parsers to the scene parsers.
    AbstractScene.AddParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedData: any, scene: Scene, container: AssetContainer, rootUrl: string) => {

        let individualParser = AbstractScene.GetIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM); 

        if (!individualParser) {
            return;
        }

        // Particles Systems
        if (parsedData.particleSystems !== undefined && parsedData.particleSystems !== null) {
            for (var index = 0, cache = parsedData.particleSystems.length; index < cache; index++) {
                var parsedParticleSystem = parsedData.particleSystems[index];
                container.particleSystems.push(individualParser(parsedParticleSystem, scene, rootUrl));
            }
        }
    });

    AbstractScene.AddIndividualParser(SceneComponentConstants.NAME_PARTICLESYSTEM, (parsedParticleSystem: any, scene: Scene, rootUrl: string) => {
        if (parsedParticleSystem.activeParticleCount) {
            let ps = GPUParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
            return ps;
        } else {
            let ps = ParticleSystem.Parse(parsedParticleSystem, scene, rootUrl);
            return ps;
        }
    });
{'fraction_non_alphanumeric': 0.09343065693430656, 'fraction_numerical': 0.00072992700729927, 'mean_word_length': 2.6498002663115847, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1078617', 'n_tokens_mistral': 747, 'n_tokens_neox': 715, 'n_words': 147}