<commit_before>"A [[Transformer]] with the default operation to narrow the type of the visited subject:
 [[transformIdentifier]] switches on the subject and descends into the `transform` method
 of the appropriate case type of [[Identifier]]. All “bottom” types’ methods are left `formal`."
see (`class Editor`)
shared interface NarrowingTransformer<out Result> satisfies Transformer<Result> {
    shared actual default Result transformArithmeticAssignmentOperation(ArithmeticAssignmentOperation that) {
        switch (that)
        case (is AddAssignmentOperation) { return transformAddAssignmentOperation(that); }
        case (is SubtractAssignmentOperation) { return transformSubtractAssignmentOperation(that); }
        case (is MultiplyAssignmentOperation) { return transformMultiplyAssignmentOperation(that); }
        case (is DivideAssignmentOperation) { return transformDivideAssignmentOperation(that); }
        case (is RemainderAssignmentOperation) { return transformRemainderAssignmentOperation(that); }
    }
    shared actual default Result transformArithmeticOperation(ArithmeticOperation that) {
        switch (that)
        case (is ExponentiationOperation) { return transformExponentiationOperation(that); }
        case (is ProductOperation) { return transformProductOperation(that); }
        case (is QuotientOperation) { return transformQuotientOperation(that); }
        case (is RemainderOperation) { return transformRemainderOperation(that); }
        case (is SumOperation) { return transformSumOperation(that); }
        case (is DifferenceOperation) { return transformDifferenceOperation(that); }
    }
    shared actual default Result transformAssignmentOperation(AssignmentOperation that) {
        switch (that)
        case (is AssignOperation) { return transformAssignOperation(that); }
        case (is ArithmeticAssignmentOperation) { return transformArithmeticAssignmentOperation(that); }
        case (is SetAssignmentOperation) { return transformSetAssignmentOperation(that); }
        case (is LogicalAssignmentOperation) { return transformLogicalAssignmentOperation(that); }
    }
    shared actual default Result transformAtom(Atom that) {
        switch (that)
        case (is Literal) { return transformLiteral(that); }
        case (is SelfReference) { return transformSelfReference(that); }
        case (is GroupedExpression) { return transformGroupedExpression(that); }
    }
    shared actual default Result transformBinaryOperation(BinaryOperation that) {
        switch (that)
        case (is ArithmeticOperation) { return transformArithmeticOperation(that); }
        case (is SetOperation) { return transformSetOperation(that); }
        case (is ScaleOperation) { return transformScaleOperation(that); }
        case (is SpanOperation) { return transformSpanOperation(that); }
        case (is MeasureOperation) { return transformMeasureOperation(that); }
        case (is EntryOperation) { return transformEntryOperation(that); }
        case (is InOperation) { return transformInOperation(that); }
        case (is ComparisonOperation) { return transformComparisonOperation(that); }
        case (is CompareOperation) { return transformCompareOperation(that); }
        case (is EqualityOperation) { return transformEqualityOperation(that); }
        case (is LogicalOperation) { return transformLogicalOperation(that); }
        case (is ThenOperation) { return transformThenOperation(that); }
        case (is ElseOperation) { return transformElseOperation(that); }
        case (is AssignmentOperation) { return transformAssignmentOperation(that); }
    }
    shared actual default Result transformComparisonOperation(ComparisonOperation that) {
        switch (that)
        case (is LargerOperation) { return transformLargerOperation(that); }
        case (is SmallerOperation) { return transformSmallerOperation(that); }
        case (is LargeAsOperation) { return transformLargeAsOperation(that); }
        case (is SmallAsOperation) { return transformSmallAsOperation(that); }
    }
    shared actual default Result transformCompilationUnit(CompilationUnit that) {
        // TODO switch on case types, call appropriate transformSubclass(that)
        throw Error("Not yet implemented!");
    }
    shared actual default Result transformDec(Dec that) {
        switch (that)
        case (is TypeDec) { return transformTypeDec(that); }
    }
    shared actual default Result transformEqualityOperation(EqualityOperation that) {
        switch (that)
        case (is EqualOperation) { return transformEqualOperation(that); }
        case (is NotEqualOperation) { return transformNotEqualOperation(that); }
        case (is IdenticalOperation) { return transformIdenticalOperation(that); }
    }
    shared actual default Result transformExpression(Expression that) {
        switch (that)
        case (is ValueExpression) { return transformValueExpression(that); }
    }
    shared actual default Result transformExpressionIsh(ExpressionIsh that) {
        switch (that)
        case (is Expression) { return transformExpression(that); }
        case (is TypeIsh) { return transformTypeIsh(that); }
        case (is Identifier) { return transformIdentifier(that); }
    }
    shared actual default Result transformIdentifier(Identifier that) {
        switch (that)
        case (is LIdentifier) { return transformLIdentifier(that); }
        case (is UIdentifier) { return transformUIdentifier(that); }
    }
    shared actual default Result transformLiteral(Literal that) {<commit_msg>Use AssertionError instead of Error<commit_after>"A [[Transformer]] with the default operation to narrow the type of the visited subject:
 [[transformIdentifier]] switches on the subject and descends into the `transform` method
 of the appropriate case type of [[Identifier]]. All “bottom” types’ methods are left `formal`."
see (`class Editor`)
shared interface NarrowingTransformer<out Result> satisfies Transformer<Result> {
    shared actual default Result transformArithmeticAssignmentOperation(ArithmeticAssignmentOperation that) {
        switch (that)
        case (is AddAssignmentOperation) { return transformAddAssignmentOperation(that); }
        case (is SubtractAssignmentOperation) { return transformSubtractAssignmentOperation(that); }
        case (is MultiplyAssignmentOperation) { return transformMultiplyAssignmentOperation(that); }
        case (is DivideAssignmentOperation) { return transformDivideAssignmentOperation(that); }
        case (is RemainderAssignmentOperation) { return transformRemainderAssignmentOperation(that); }
    }
    shared actual default Result transformArithmeticOperation(ArithmeticOperation that) {
        switch (that)
        case (is ExponentiationOperation) { return transformExponentiationOperation(that); }
        case (is ProductOperation) { return transformProductOperation(that); }
        case (is QuotientOperation) { return transformQuotientOperation(that); }
        case (is RemainderOperation) { return transformRemainderOperation(that); }
        case (is SumOperation) { return transformSumOperation(that); }
        case (is DifferenceOperation) { return transformDifferenceOperation(that); }
    }
    shared actual default Result transformAssignmentOperation(AssignmentOperation that) {
        switch (that)
        case (is AssignOperation) { return transformAssignOperation(that); }
        case (is ArithmeticAssignmentOperation) { return transformArithmeticAssignmentOperation(that); }
        case (is SetAssignmentOperation) { return transformSetAssignmentOperation(that); }
        case (is LogicalAssignmentOperation) { return transformLogicalAssignmentOperation(that); }
    }
    shared actual default Result transformAtom(Atom that) {
        switch (that)
        case (is Literal) { return transformLiteral(that); }
        case (is SelfReference) { return transformSelfReference(that); }
        case (is GroupedExpression) { return transformGroupedExpression(that); }
    }
    shared actual default Result transformBinaryOperation(BinaryOperation that) {
        switch (that)
        case (is ArithmeticOperation) { return transformArithmeticOperation(that); }
        case (is SetOperation) { return transformSetOperation(that); }
        case (is ScaleOperation) { return transformScaleOperation(that); }
        case (is SpanOperation) { return transformSpanOperation(that); }
        case (is MeasureOperation) { return transformMeasureOperation(that); }
        case (is EntryOperation) { return transformEntryOperation(that); }
        case (is InOperation) { return transformInOperation(that); }
        case (is ComparisonOperation) { return transformComparisonOperation(that); }
        case (is CompareOperation) { return transformCompareOperation(that); }
        case (is EqualityOperation) { return transformEqualityOperation(that); }
        case (is LogicalOperation) { return transformLogicalOperation(that); }
        case (is ThenOperation) { return transformThenOperation(that); }
        case (is ElseOperation) { return transformElseOperation(that); }
        case (is AssignmentOperation) { return transformAssignmentOperation(that); }
    }
    shared actual default Result transformComparisonOperation(ComparisonOperation that) {
        switch (that)
        case (is LargerOperation) { return transformLargerOperation(that); }
        case (is SmallerOperation) { return transformSmallerOperation(that); }
        case (is LargeAsOperation) { return transformLargeAsOperation(that); }
        case (is SmallAsOperation) { return transformSmallAsOperation(that); }
    }
    shared actual default Result transformCompilationUnit(CompilationUnit that) {
        // TODO switch on case types, call appropriate transformSubclass(that)
        throw AssertionError("Not yet implemented!");
    }
    shared actual default Result transformDec(Dec that) {
        switch (that)
        case (is TypeDec) { return transformTypeDec(that); }
    }
    shared actual default Result transformEqualityOperation(EqualityOperation that) {
        switch (that)
        case (is EqualOperation) { return transformEqualOperation(that); }
        case (is NotEqualOperation) { return transformNotEqualOperation(that); }
        case (is IdenticalOperation) { return transformIdenticalOperation(that); }
    }
    shared actual default Result transformExpression(Expression that) {
        switch (that)
        case (is ValueExpression) { return transformValueExpression(that); }
    }
    shared actual default Result transformExpressionIsh(ExpressionIsh that) {
        switch (that)
        case (is Expression) { return transformExpression(that); }
        case (is TypeIsh) { return transformTypeIsh(that); }
        case (is Identifier) { return transformIdentifier(that); }
    }
    shared actual default Result transformIdentifier(Identifier that) {
        switch (that)
        case (is LIdentifier) { return transformLIdentifier(that); }
        case (is UIdentifier) { return transformUIdentifier(that); }
    }
    shared actual default Result transformLiteral(Literal that) {
{'fraction_non_alphanumeric': 0.07931807985643786, 'fraction_numerical': 0.0, 'mean_word_length': 4.119889756545705, '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': '1210497', 'n_tokens_mistral': 2585, 'n_tokens_neox': 2580, 'n_words': 784}