<commit_before>package polyglot.ext.jl5;

import polyglot.ast.NodeFactory;
import polyglot.ext.jl5.types.JL5TypeSystem;
import polyglot.ext.jl5.visit.*;
import polyglot.frontend.*;
import polyglot.frontend.ExtensionInfo;
import polyglot.frontend.goals.CodeGenerated;
import polyglot.frontend.goals.EmptyGoal;
import polyglot.frontend.goals.Goal;
import polyglot.frontend.goals.VisitorGoal;
import polyglot.main.Options;
import polyglot.types.TypeSystem;
import polyglot.util.InternalCompilerError;

public class JL5Scheduler extends JLScheduler {

    JL5Scheduler(JLExtensionInfo extInfo) {
        super(extInfo);
    }

//    @Override
//	public Goal TypeChecked(Job job) {
//    	Goal g = super.TypeChecked(job);
//    	try {
//        	g.addPrerequisiteGoal(CastsInserted(job),this);
//        } catch (CyclicDependencyException e) {
//            throw new InternalCompilerError(e);
//        }
//    	return g;
//	}

	public Goal CastsInserted(Job job) {
        TypeSystem ts = extInfo.typeSystem();
        NodeFactory nf = extInfo.nodeFactory();
//        Goal g = new VisitorGoal(job, new CastingTypeChecker(job, ts, nf));
        Goal g = new VisitorGoal(job, new TVCaster(job, ts, nf, true));
        try {
//        	g.addPrerequisiteGoal(Disambiguated(job),this);
            g.addPrerequisiteGoal(TypeChecked(job), this);
            g.addPrerequisiteGoal(AutoBoxing(job), this);
            g.addPrerequisiteGoal(RemoveExtendedFors(job), this);
        } catch (CyclicDependencyException e) {
            throw new InternalCompilerError(e);
        }
        return this.internGoal(g);

    }
    public Goal AutoBoxing(Job job) {
        JL5TypeSystem ts = (JL5TypeSystem)extInfo.typeSystem();
        NodeFactory nf = extInfo.nodeFactory();
        Goal g = new VisitorGoal(job, new AutoBoxer(job, ts, nf));
        try {
            g.addPrerequisiteGoal(TypeChecked(job), this);
            g.addPrerequisiteGoal(RemoveVarArgs(job), this);
            g.addPrerequisiteGoal(SimplifyExpressionsForBoxing(job), this);
        } catch (CyclicDependencyException e) {
            throw new InternalCompilerError(e);<commit_msg>Remove extended fors before performing autoboxing.<commit_after>package polyglot.ext.jl5;

import polyglot.ast.NodeFactory;
import polyglot.ext.jl5.types.JL5TypeSystem;
import polyglot.ext.jl5.visit.*;
import polyglot.frontend.*;
import polyglot.frontend.ExtensionInfo;
import polyglot.frontend.goals.CodeGenerated;
import polyglot.frontend.goals.EmptyGoal;
import polyglot.frontend.goals.Goal;
import polyglot.frontend.goals.VisitorGoal;
import polyglot.main.Options;
import polyglot.types.TypeSystem;
import polyglot.util.InternalCompilerError;

public class JL5Scheduler extends JLScheduler {

    JL5Scheduler(JLExtensionInfo extInfo) {
        super(extInfo);
    }

//    @Override
//	public Goal TypeChecked(Job job) {
//    	Goal g = super.TypeChecked(job);
//    	try {
//        	g.addPrerequisiteGoal(CastsInserted(job),this);
//        } catch (CyclicDependencyException e) {
//            throw new InternalCompilerError(e);
//        }
//    	return g;
//	}

	public Goal CastsInserted(Job job) {
        TypeSystem ts = extInfo.typeSystem();
        NodeFactory nf = extInfo.nodeFactory();
//        Goal g = new VisitorGoal(job, new CastingTypeChecker(job, ts, nf));
        Goal g = new VisitorGoal(job, new TVCaster(job, ts, nf, true));
        try {
//        	g.addPrerequisiteGoal(Disambiguated(job),this);
            g.addPrerequisiteGoal(TypeChecked(job), this);
            g.addPrerequisiteGoal(AutoBoxing(job), this);
            g.addPrerequisiteGoal(RemoveExtendedFors(job), this);
        } catch (CyclicDependencyException e) {
            throw new InternalCompilerError(e);
        }
        return this.internGoal(g);

    }
    public Goal AutoBoxing(Job job) {
        JL5TypeSystem ts = (JL5TypeSystem)extInfo.typeSystem();
        NodeFactory nf = extInfo.nodeFactory();
        Goal g = new VisitorGoal(job, new AutoBoxer(job, ts, nf));
        try {
            g.addPrerequisiteGoal(TypeChecked(job), this);
            g.addPrerequisiteGoal(RemoveVarArgs(job), this);
            g.addPrerequisiteGoal(RemoveExtendedFors(job), this);
            g.addPrerequisiteGoal(SimplifyExpressionsForBoxing(job), this);
        } catch (CyclicDependencyException e) {
            throw new InternalCompilerError(e);
{'fraction_non_alphanumeric': 0.11022546117057617, 'fraction_numerical': 0.0036438168982008655, 'mean_word_length': 3.120075046904315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4425916', 'n_tokens_mistral': 1462, 'n_tokens_neox': 1421, 'n_words': 258}