<commit_before>import 'package:code_builder/code_builder.dart' as dart;
import 'package:compiler/compiler.dart';

import '../body.dart';
import '../constants.dart';
import '../type.dart';
import 'declaration.dart';
import 'module.dart';

final compileFunction = Query<DeclarationId, dart.Method>(
  'dart.compileFunction',
  evaluateAlways: true,
  provider: (context, declarationId) {
    final functionHir = getFunctionDeclarationHir(context, declarationId);
    final moduleId = declarationIdToModuleId(context, declarationId);

    dart.Code body;
    if (moduleId == ModuleId.coreCollections.nested(['list', 'List']) &&
        declarationId.simplePath.last.nameOrNull.startsWith('of')) {
      body = _compileListOf(context, functionHir);
    } else if (moduleId ==
            ModuleId.coreCollections.nested(['list', 'array', 'ArrayList']) &&
        declarationId.simplePath.last.nameOrNull.startsWith('of')) {
      body = _compileArrayListOf(functionHir);
    }
    body ??= compileBody(context, declarationId).valueOrNull;

    // TODO(JonasWanke): make this safer
    const operatorMethods = {
      'add': 'operator +',
      'subtract': 'operator -',
      'multiply': 'operator *',
      'divide': 'operator /',
      'divideTruncating': 'operator ~/',
      'modulo': 'operator %',
      'compareTo': 'compareToTyped',<commit_msg>Remove legacy builtins for of1, of2, etc.<commit_after>import 'package:code_builder/code_builder.dart' as dart;
import 'package:compiler/compiler.dart';

import '../body.dart';
import '../constants.dart';
import '../type.dart';
import 'declaration.dart';
import 'module.dart';

final compileFunction = Query<DeclarationId, dart.Method>(
  'dart.compileFunction',
  evaluateAlways: true,
  provider: (context, declarationId) {
    final functionHir = getFunctionDeclarationHir(context, declarationId);

    final body = compileBody(context, declarationId).valueOrNull;

    // TODO(JonasWanke): make this safer
    const operatorMethods = {
      'add': 'operator +',
      'subtract': 'operator -',
      'multiply': 'operator *',
      'divide': 'operator /',
      'divideTruncating': 'operator ~/',
      'modulo': 'operator %',
      'compareTo': 'compareToTyped',
{'fraction_non_alphanumeric': 0.1507900677200903, 'fraction_numerical': 0.0009029345372460496, 'mean_word_length': 4.105990783410138, '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': '4150777', 'n_tokens_mistral': 673, 'n_tokens_neox': 666, 'n_words': 135}