<commit_before>import ceylon.collection {
    HashSet,
    LinkedList
}
import ceylon.interop.java {
    CeylonList
}

import com.redhat.ceylon.compiler.typechecker.context {
    PhasedUnit
}
import com.redhat.ceylon.model.typechecker.model {
    UnitModel=Unit,
    ClassOrInterfaceModel=ClassOrInterface,
    FunctionOrValueModel=FunctionOrValue
}
import com.vasileff.ceylon.dart.ast {
    DartCompilationUnitMember,
    DartSimpleIdentifier
}
import com.vasileff.jl4c.guava.collect {
    HashMultimap,
    MutableSetMultimap
}

import org.antlr.runtime {
    Token
}

shared
class CompilationContext(PhasedUnit phasedUnit) {

    shared
    UnitModel unit = phasedUnit.unit;

    shared
    List<Token> tokens = CeylonList(phasedUnit.tokens);

    "The output."
    shared
    LinkedList<DartCompilationUnitMember> compilationUnitMembers
        =   LinkedList<DartCompilationUnitMember>();

    shared
    HashSet<FunctionOrValueModel> disableErasureToNative
        =   HashSet<FunctionOrValueModel>();

    shared
    HashSet<FunctionOrValueModel> capturedDeclarations
        =   HashSet<FunctionOrValueModel>();

    shared
    MutableSetMultimap<ClassOrInterfaceModel, FunctionOrValueModel> captures
        =   HashMultimap<ClassOrInterfaceModel, FunctionOrValueModel>();

    shared variable
    DartSimpleIdentifier? doFailVariableTop = null;

    "Boxing should calculate a denotable type. Trumps other `lhs` values."
    shared variable
    ClassOrInterfaceModel? lhsDenotableTop = null;

    shared variable
    TypeOrNoType? lhsTypeTop = null;

    shared variable
    Boolean? lhsErasedToNativeTop = null;

    shared variable
    Boolean? lhsErasedToObjectTop = null;

    shared variable
    FunctionOrValueModel? returnDeclarationTop = null;

    shared
    CeylonTypes ceylonTypes = CeylonTypes(unit);
<commit_msg>preserve order in capture lists<commit_after>import ceylon.collection {
    HashSet,
    LinkedList
}
import ceylon.interop.java {
    CeylonList
}

import com.redhat.ceylon.compiler.typechecker.context {
    PhasedUnit
}
import com.redhat.ceylon.model.typechecker.model {
    UnitModel=Unit,
    ClassOrInterfaceModel=ClassOrInterface,
    FunctionOrValueModel=FunctionOrValue
}
import com.vasileff.ceylon.dart.ast {
    DartCompilationUnitMember,
    DartSimpleIdentifier
}
import com.vasileff.jl4c.guava.collect {
    HashMultimap,
    MutableSetMultimap,
    LinkedHashMultimap
}

import org.antlr.runtime {
    Token
}

shared
class CompilationContext(PhasedUnit phasedUnit) {

    shared
    UnitModel unit = phasedUnit.unit;

    shared
    List<Token> tokens = CeylonList(phasedUnit.tokens);

    "The output."
    shared
    LinkedList<DartCompilationUnitMember> compilationUnitMembers
        =   LinkedList<DartCompilationUnitMember>();

    shared
    HashSet<FunctionOrValueModel> disableErasureToNative
        =   HashSet<FunctionOrValueModel>();

    shared
    HashSet<FunctionOrValueModel> capturedDeclarations
        =   HashSet<FunctionOrValueModel>();

    "A multimap to associated each capturing class and interface with its list of
     captures. A [[LinkedHashMultimap]] is used to preserve insertion order. A
     consistent order is important as the capture lists will be used to build parameter
     and argument lists."
    shared
    LinkedHashMultimap<ClassOrInterfaceModel, FunctionOrValueModel> captures
        =   LinkedHashMultimap<ClassOrInterfaceModel, FunctionOrValueModel>();

    shared variable
    DartSimpleIdentifier? doFailVariableTop = null;

    "Boxing should calculate a denotable type. Trumps other `lhs` values."
    shared variable
    ClassOrInterfaceModel? lhsDenotableTop = null;

    shared variable
    TypeOrNoType? lhsTypeTop = null;

    shared variable
    Boolean? lhsErasedToNativeTop = null;

    shared variable
    Boolean? lhsErasedToObjectTop = null;

    shared variable
    FunctionOrValueModel? returnDeclarationTop = null;

    shared
    CeylonTypes ceylonTypes = CeylonTypes(unit);

{'fraction_non_alphanumeric': 0.06561482594540446, 'fraction_numerical': 0.0005008765339343851, 'mean_word_length': 3.870731707317073, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '1895226', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1149, 'n_words': 249}