<commit_before>// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library fasta.analyzer.mock_element;

import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';

import '../builder/builder.dart' show
    Builder;

import '../errors.dart' show
    internalError;

abstract class MockElement extends Builder
    implements Element, LocalElement {
  final ElementKind kind;

  MockElement(this.kind)
      : super(null, -1, null);

  get librarySource => internalError("not supported.");

  get source => internalError("not supported.");

  get context => internalError("not supported.");

  String get displayName => internalError("not supported.");

  String get documentationComment => internalError("not supported.");

  Element get enclosingElement => internalError("not supported.");

  int get id => internalError("not supported.");

  bool get isDeprecated => internalError("not supported.");

  bool get isFactory => internalError("not supported.");

  bool get isJS => internalError("not supported.");

  bool get isOverride => internalError("not supported.");

  bool get isPrivate => internalError("not supported.");

  bool get isProtected => internalError("not supported.");

  bool get isPublic => internalError("not supported.");

  bool get isRequired => internalError("not supported.");

  bool get isSynthetic => internalError("not supported.");

  LibraryElement get library => internalError("not supported.");

  get location => internalError("not supported.");

  get metadata => internalError("not supported.");

  String get name => internalError("not supported.");

  int get nameLength => internalError("not supported.");

  int get nameOffset => -1;

  get unit => internalError("not supported.");

  accept<T>(visitor) => internalError("not supported.");

  String computeDocumentationComment() => internalError("not supported.");

  computeNode() => internalError("not supported.");

  getAncestor<E>(predicate) => internalError("not supported.");

  String getExtendedDisplayName(String shortName) {
    return internalError("not supported.");
  }

  bool isAccessibleIn(LibraryElement library) {
    return internalError("not supported.");
  }

  void visitChildren(visitor) => internalError("not supported.");

  String get uri => internalError("not supported.");

  int get uriEnd => internalError("not supported.");

  int get uriOffset => internalError("not supported.");

  List<ParameterElement> get parameters => internalError("not supported.");

  List<FunctionElement> get functions => internalError("not supported.");

  bool get hasImplicitReturnType => internalError("not supported.");

  bool get isAbstract => internalError("not supported.");

  bool get isAsynchronous => internalError("not supported.");

  bool get isExternal => internalError("not supported.");

  bool get isGenerator => internalError("not supported.");

  bool get isOperator => internalError("not supported.");

  bool get isStatic => internalError("not supported.");

  bool get isSynchronous => internalError("not supported.");

  List<LabelElement> get labels => internalError("not supported.");

  List<LocalVariableElement> get localVariables {
    return internalError("not supported.");
  }

  get visibleRange => internalError("not supported.");

  bool get hasImplicitType => internalError("not supported.");

  FunctionElement get initializer => internalError("not supported.");

  bool get isConst => internalError("not supported.");

  bool get isFinal => internalError("not supported.");

  bool get isPotentiallyMutatedInClosure => internalError("not supported.");

  bool get isPotentiallyMutatedInScope => internalError("not supported.");
}

abstract class MockLibraryElement extends MockElement
    implements LibraryElement {
  MockLibraryElement()
      : super(ElementKind.LIBRARY);

  CompilationUnitElement get definingCompilationUnit {
    return internalError("not supported.");
  }

  FunctionElement get entryPoint => internalError("not supported.");

  List<LibraryElement> get exportedLibraries {
    return internalError("not supported.");
  }

  get exportNamespace => internalError("not supported.");

  get exports => internalError("not supported.");

  bool get hasExtUri => internalError("not supported.");

  bool get hasLoadLibraryFunction => internalError("not supported.");

  String get identifier => internalError("not supported.");

  List<LibraryElement> get importedLibraries {
    return internalError("not supported.");
  }

  get imports => internalError("not supported.");

  bool get isBrowserApplication => internalError("not supported.");

  bool get isDartAsync => internalError("not supported.");

  bool get isDartCore => internalError("not supported.");

  bool get isInSdk => internalError("not supported.");

  List<LibraryElement> get libraryCycle => internalError("not supported.");

  FunctionElement get loadLibraryFunction => internalError("not supported.");

  List<CompilationUnitElement> get parts => internalError("not supported.");

  List<PrefixElement> get prefixes => internalError("not supported.");

  get publicNamespace => internalError("not supported.");

  List<CompilationUnitElement> get units => internalError("not supported.");

  getImportsWithPrefix(PrefixElement prefix) {
    return internalError("not supported.");
  }

  ClassElement getType(String className) => internalError("not supported.");
}

abstract class MockCompilationUnitElement extends MockElement
    implements CompilationUnitElement {
  MockCompilationUnitElement()
      : super(ElementKind.COMPILATION_UNIT);

  List<PropertyAccessorElement> get accessors {
    return internalError("not supported.");
  }

  LibraryElement get enclosingElement => internalError("not supported.");

  List<ClassElement> get enums => internalError("not supported.");

  List<FunctionElement> get functions => internalError("not supported.");

  List<FunctionTypeAliasElement> get functionTypeAliases {
    return internalError("not supported.");
  }

  bool get hasLoadLibraryFunction => internalError("not supported.");

  List<TopLevelVariableElement> get topLevelVariables {
    return internalError("not supported.");
  }

  List<ClassElement> get types => internalError("not supported.");

  Element getElementAt(int offset) => internalError("not supported.");

  ClassElement getEnum(String name) => internalError("not supported.");

  ClassElement getType(String name) => internalError("not supported.");

  CompilationUnit computeNode() => internalError("not supported.");
}

abstract class MockClassElement extends MockElement implements ClassElement {
  MockClassElement()
      : super(ElementKind.CLASS);
<commit_msg>Implement CompilationUnitElement.lineInfo in MockCompilationUnitElement.<commit_after>// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

library fasta.analyzer.mock_element;

import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';

import '../builder/builder.dart' show
    Builder;

import '../errors.dart' show
    internalError;
import 'package:analyzer/src/generated/source.dart';

abstract class MockElement extends Builder
    implements Element, LocalElement {
  final ElementKind kind;

  MockElement(this.kind)
      : super(null, -1, null);

  get librarySource => internalError("not supported.");

  get source => internalError("not supported.");

  get context => internalError("not supported.");

  String get displayName => internalError("not supported.");

  String get documentationComment => internalError("not supported.");

  Element get enclosingElement => internalError("not supported.");

  int get id => internalError("not supported.");

  bool get isDeprecated => internalError("not supported.");

  bool get isFactory => internalError("not supported.");

  bool get isJS => internalError("not supported.");

  bool get isOverride => internalError("not supported.");

  bool get isPrivate => internalError("not supported.");

  bool get isProtected => internalError("not supported.");

  bool get isPublic => internalError("not supported.");

  bool get isRequired => internalError("not supported.");

  bool get isSynthetic => internalError("not supported.");

  LibraryElement get library => internalError("not supported.");

  get location => internalError("not supported.");

  get metadata => internalError("not supported.");

  String get name => internalError("not supported.");

  int get nameLength => internalError("not supported.");

  int get nameOffset => -1;

  get unit => internalError("not supported.");

  accept<T>(visitor) => internalError("not supported.");

  String computeDocumentationComment() => internalError("not supported.");

  computeNode() => internalError("not supported.");

  getAncestor<E>(predicate) => internalError("not supported.");

  String getExtendedDisplayName(String shortName) {
    return internalError("not supported.");
  }

  bool isAccessibleIn(LibraryElement library) {
    return internalError("not supported.");
  }

  void visitChildren(visitor) => internalError("not supported.");

  String get uri => internalError("not supported.");

  int get uriEnd => internalError("not supported.");

  int get uriOffset => internalError("not supported.");

  List<ParameterElement> get parameters => internalError("not supported.");

  List<FunctionElement> get functions => internalError("not supported.");

  bool get hasImplicitReturnType => internalError("not supported.");

  bool get isAbstract => internalError("not supported.");

  bool get isAsynchronous => internalError("not supported.");

  bool get isExternal => internalError("not supported.");

  bool get isGenerator => internalError("not supported.");

  bool get isOperator => internalError("not supported.");

  bool get isStatic => internalError("not supported.");

  bool get isSynchronous => internalError("not supported.");

  List<LabelElement> get labels => internalError("not supported.");

  List<LocalVariableElement> get localVariables {
    return internalError("not supported.");
  }

  get visibleRange => internalError("not supported.");

  bool get hasImplicitType => internalError("not supported.");

  FunctionElement get initializer => internalError("not supported.");

  bool get isConst => internalError("not supported.");

  bool get isFinal => internalError("not supported.");

  bool get isPotentiallyMutatedInClosure => internalError("not supported.");

  bool get isPotentiallyMutatedInScope => internalError("not supported.");
}

abstract class MockLibraryElement extends MockElement
    implements LibraryElement {
  MockLibraryElement()
      : super(ElementKind.LIBRARY);

  CompilationUnitElement get definingCompilationUnit {
    return internalError("not supported.");
  }

  FunctionElement get entryPoint => internalError("not supported.");

  List<LibraryElement> get exportedLibraries {
    return internalError("not supported.");
  }

  get exportNamespace => internalError("not supported.");

  get exports => internalError("not supported.");

  bool get hasExtUri => internalError("not supported.");

  bool get hasLoadLibraryFunction => internalError("not supported.");

  String get identifier => internalError("not supported.");

  List<LibraryElement> get importedLibraries {
    return internalError("not supported.");
  }

  get imports => internalError("not supported.");

  bool get isBrowserApplication => internalError("not supported.");

  bool get isDartAsync => internalError("not supported.");

  bool get isDartCore => internalError("not supported.");

  bool get isInSdk => internalError("not supported.");

  List<LibraryElement> get libraryCycle => internalError("not supported.");

  FunctionElement get loadLibraryFunction => internalError("not supported.");

  List<CompilationUnitElement> get parts => internalError("not supported.");

  List<PrefixElement> get prefixes => internalError("not supported.");

  get publicNamespace => internalError("not supported.");

  List<CompilationUnitElement> get units => internalError("not supported.");

  getImportsWithPrefix(PrefixElement prefix) {
    return internalError("not supported.");
  }

  ClassElement getType(String className) => internalError("not supported.");
}

abstract class MockCompilationUnitElement extends MockElement
    implements CompilationUnitElement {
  MockCompilationUnitElement()
      : super(ElementKind.COMPILATION_UNIT);

  List<PropertyAccessorElement> get accessors {
    return internalError("not supported.");
  }

  LibraryElement get enclosingElement => internalError("not supported.");

  List<ClassElement> get enums => internalError("not supported.");

  List<FunctionElement> get functions => internalError("not supported.");

  List<FunctionTypeAliasElement> get functionTypeAliases {
    return internalError("not supported.");
  }

  bool get hasLoadLibraryFunction => internalError("not supported.");

  @override
  LineInfo get lineInfo => internalError("not supported.");

  List<TopLevelVariableElement> get topLevelVariables {
    return internalError("not supported.");
  }

  List<ClassElement> get types => internalError("not supported.");

  Element getElementAt(int offset) => internalError("not supported.");

  ClassElement getEnum(String name) => internalError("not supported.");

  ClassElement getType(String name) => internalError("not supported.");

  CompilationUnit computeNode() => internalError("not supported.");
}

abstract class MockClassElement extends MockElement implements ClassElement {
  MockClassElement()
      : super(ElementKind.CLASS);

{'fraction_non_alphanumeric': 0.121576438784947, 'fraction_numerical': 0.0008536672120651633, 'mean_word_length': 5.157687253613666, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 192, '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': '1213021', 'n_tokens_mistral': 3528, 'n_tokens_neox': 3329, 'n_words': 1037}