<commit_before>package com.semperos.screwdriver.js.coffeescript;

import com.semperos.screwdriver.js.RhinoCompiler;
import com.semperos.screwdriver.js.RhinoEvaluator;
import com.semperos.screwdriver.js.RhinoEvaluatorException;

import java.io.IOException;
import java.util.HashMap;

/**
 * Compile CoffeeScript via Rhino
 */
public class CoffeeScriptCompiler {
    private RhinoCompiler eva;

    public CoffeeScriptCompiler() {
        eva = new RhinoCompiler();
        HashMap<String,String> deps = new HashMap<String,String>();
        deps.put("coffee-script.js", "com/semperos/screwdriver/js/vendor/coffee-script-1.4.0.js");
        eva.addDependencies(deps);
    }

    /**
     * Compile CoffeeScript to JavaScript
     *
     * @todo Provide facility to pass custom options to CoffeeScript compiler (e.g., --bare)
     *
     * @param coffeeScriptSource The CoffeeScript source code to be compiled
     * @return The resultant JavaScript
     * @throws CoffeeScriptCompileException
     */
    public String compile(String coffeeScriptSource) throws IOException, RhinoEvaluatorException {
        eva.registerCompiler("CoffeeScriptCompiler", "com/semperos/screwdriver/js/extension/compile-coffeescript.js");
        eva.compilerArgs(coffeeScriptSource);
        return eva.compile();
    }
}<commit_msg>Todo has been done, compilerOptions can be passed in<commit_after>package com.semperos.screwdriver.js.coffeescript;

import com.semperos.screwdriver.js.RhinoCompiler;
import com.semperos.screwdriver.js.RhinoEvaluator;
import com.semperos.screwdriver.js.RhinoEvaluatorException;

import java.io.IOException;
import java.util.HashMap;

/**
 * Compile CoffeeScript via Rhino
 */
public class CoffeeScriptCompiler {
    private RhinoCompiler eva;

    public CoffeeScriptCompiler() {
        eva = new RhinoCompiler();
        HashMap<String,String> deps = new HashMap<String,String>();
        deps.put("coffee-script.js", "com/semperos/screwdriver/js/vendor/coffee-script-1.4.0.js");
        eva.addDependencies(deps);
    }

    /**
     * Compile CoffeeScript to JavaScript
     *
     * @param coffeeScriptSource The CoffeeScript source code to be compiled
     * @return The resultant JavaScript
     * @throws CoffeeScriptCompileException
     */
    public String compile(String coffeeScriptSource) throws IOException, RhinoEvaluatorException {
        eva.registerCompiler("CoffeeScriptCompiler", "com/semperos/screwdriver/js/extension/compile-coffeescript.js");
        eva.compilerArgs(coffeeScriptSource);
        return eva.compile();
    }
}
{'fraction_non_alphanumeric': 0.10027311744049941, 'fraction_numerical': 0.0023410066328521262, 'mean_word_length': 3.8286252354048966, 'pattern_counts': {'":': 0, '<': 7, '<?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': '20470', 'n_tokens_mistral': 785, 'n_tokens_neox': 754, 'n_words': 150}