<commit_before>package slogo.backend.impl.evaluation.commands.control;

public class Repeat {

}<commit_msg>repeat implemented<commit_after>package slogo.backend.impl.evaluation.commands.control;

import java.util.List;

import slogo.backend.evaluation.IExecutionContext;
import slogo.backend.evaluation.MalformedSyntaxException;
import slogo.backend.impl.evaluation.Evaluator;
import slogo.backend.impl.evaluation.commands.Operation;
import slogo.backend.parsing.ISyntaxNode;

public class Repeat extends Operation{

    public Repeat (String type, int argMin, int argMax) {
        super(type, 2, 2);
        // TODO Auto-generated constructor stub
    }

    @Override
    protected IExecutionContext executeRaw (List<IExecutionContext> args, IExecutionContext previous, ISyntaxNode current) {
        // TODO Auto-generated method stub
        String argumentTwo = args.get(1).environment().get("returnValue");
        int times = Integer.parseInt(argumentTwo);
        //Error check times > 1
        Evaluator e = new Evaluator();
        IExecutionContext context = args.get(0);
        for (int i = 0 ; i<times-1; i++){
            try {
                context = e.evaluate(current.children().get(0), context);
            } catch (MalformedSyntaxException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
        }
        return context;
    }

}
{'fraction_non_alphanumeric': 0.0995059985885674, 'fraction_numerical': 0.007057163020465773, 'mean_word_length': 2.8956043956043955, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2495644', 'n_tokens_mistral': 389, 'n_tokens_neox': 380, 'n_words': 91}