front_end 0.1.16

Front end for Dart #

This package provides a low-level API for use by compiler back ends that wish to implement the Dart language. It is intended for eventual use by dev_compiler, dart2js, and the Dart VM. In addition, it will share implementation details with the analyzer package--this will be accomplished by having the analyzer package import (and re-export) parts of this package's private implementation.

End-users should use the [dartanalyzer][analyzercli] command-line tool to analyze their Dart code.

Integrators that want to write tools that analyze Dart code should use the [analyzer] package.

Note: The APIs in this package are in an early state; developers should be careful about depending on this package. In particular, there is no semver contract for release versions of this package. Please depend directly on individual versions.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  front_end: ^0.1.16

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

Popularity:
Describes how popular the package is relative to other packages. [more]
97
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
30
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Jan 18, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.2

Health issues and suggestions

Fix lib/src/fasta/testing/scanner_chain.dart. (-98.69 points)

Analysis of lib/src/fasta/testing/scanner_chain.dart failed with 15 errors, 4 hints, including:

line 7 col 8: Target of URI doesn't exist: 'package:testing/testing.dart'.

line 29 col 20: Classes can only extend other classes.

line 29 col 20: Undefined class 'Step'.

line 29 col 25: The name 'TestDescription' isn't a type so it can't be used as a type argument.

line 29 col 52: The name 'ChainContext' isn't a type so it can't be used as a type argument.

Fix lib/src/fasta/testing/kernel_chain.dart. (-96.99 points)

Analysis of lib/src/fasta/testing/kernel_chain.dart failed with 10 errors, 125 hints, including:

line 35 col 8: Target of URI doesn't exist: 'package:testing/testing.dart'.

line 144 col 12: The method 'pass' isn't defined for the class 'Print'.

line 173 col 16: The method 'pass' isn't defined for the class 'Verify'.

line 194 col 14: The method 'pass' isn't defined for the class 'TypeCheck'.

line 314 col 14: The method 'pass' isn't defined for the class 'KernelTextSerialization'.

Fix lib/src/fasta/fasta_codes_generated.dart. (-100 points)

Analysis of lib/src/fasta/fasta_codes_generated.dart reported 2507 hints, including:

line 15 col 5: Avoid const keyword.

line 22 col 5: Avoid const keyword.

line 23 col 9: Prefer single quotes where they won't require escape sequences.

line 24 col 33: Prefer single quotes where they won't require escape sequences.

line 31 col 10: Unnecessary new keyword.

Fix additional 192 files with analysis or formatting issues. (-2980.98 points)

Additional issues in the following files:

  • lib/src/fasta/kernel/body_builder.dart (849 hints)
  • lib/src/fasta/parser/parser.dart (535 hints)
  • lib/src/scanner/token.dart (456 hints)
  • lib/src/fasta/kernel/constant_evaluator.dart (450 hints)
  • lib/src/fasta/source/type_promotion_look_ahead_listener.dart (250 hints)
  • lib/src/fasta/kernel/kernel_library_builder.dart (244 hints)
  • lib/src/fasta/kernel/kernel_class_builder.dart (233 hints)
  • lib/src/fasta/source/outline_builder.dart (233 hints)
  • lib/src/fasta/source/source_loader.dart (221 hints)
  • lib/src/fasta/incremental_compiler.dart (205 hints)
  • lib/src/fasta/kernel/inference_visitor.dart (180 hints)
  • lib/src/fasta/parser/listener.dart (175 hints)
  • lib/src/fasta/kernel/kernel_expression_generator.dart (170 hints)
  • lib/src/fasta/kernel/kernel_target.dart (159 hints)
  • lib/src/fasta/kernel/class_hierarchy_builder.dart (153 hints)
  • lib/src/fasta/kernel/expression_generator.dart (152 hints)
  • lib/src/fasta/source/diet_listener.dart (150 hints)
  • lib/src/fasta/kernel/transform_collections.dart (140 hints)
  • lib/src/fasta/kernel/kernel_shadow_ast.dart (130 hints)
  • lib/src/fasta/type_inference/type_inferrer.dart (123 hints)
  • lib/src/fasta/kernel/kernel_expression_generator_impl.dart (116 hints)
  • lib/src/fasta/kernel/type_labeler.dart (114 hints)
  • lib/src/fasta/source/source_library_builder.dart (111 hints)
  • lib/src/fasta/kernel/type_algorithms.dart (109 hints)
  • lib/src/fasta/scanner/abstract_scanner.dart (104 hints)
  • lib/src/fasta/kernel/fangorn.dart (94 hints)
  • lib/src/fasta/scope.dart (88 hints)
  • lib/src/fasta/util/link.dart (88 hints)
  • lib/src/fasta/kernel/kernel_enum_builder.dart (87 hints)
  • lib/src/fasta/rewrite_severity.dart (77 hints)
  • lib/src/fasta/type_inference/interface_resolver.dart (76 hints)
  • lib/src/fasta/source/stack_listener.dart (75 hints)
  • lib/src/fasta/parser/type_info_impl.dart (73 hints)
  • lib/src/fasta/kernel/kernel_procedure_builder.dart (68 hints)
  • lib/src/fasta/scanner/token.dart (60 hints)
  • lib/src/base/errors.dart (59 hints)
  • lib/src/fasta/names.dart (59 hints)
  • lib/src/fasta/parser/identifier_context.dart (52 hints)
  • lib/src/fasta/fasta_codes.dart (50 hints)
  • lib/src/fasta/scanner/array_based_scanner.dart (49 hints)
  • lib/src/fasta/util/link_implementation.dart (49 hints)
  • lib/src/fasta/kernel/types.dart (48 hints)
  • lib/src/base/processed_options.dart (45 hints)
  • lib/src/fasta/operator.dart (42 hints)
  • lib/src/fasta/scanner/keyword_state.dart (41 hints)
  • lib/src/fasta/kernel/utils.dart (40 hints)
  • lib/src/fasta/quote.dart (40 hints)
  • lib/src/fasta/scanner/error_token.dart (39 hints)
  • lib/src/scanner/errors.dart (39 hints)
  • lib/src/fasta/kernel/collections.dart (38 hints)
  • lib/src/fasta/kernel/type_builder_computer.dart (38 hints)
  • lib/src/fasta/command_line_reporting.dart (36 hints)
  • lib/src/api_unstable/ddc.dart (35 hints)
  • lib/src/fasta/loader.dart (35 hints)
  • lib/src/fasta/parser/identifier_context_impl.dart (35 hints)
  • lib/src/base/library_info.dart (34 hints)
  • lib/src/fasta/dill/dill_class_builder.dart (33 hints)
  • lib/src/fasta/dill/dill_library_builder.dart (33 hints)
  • lib/src/fasta/kernel/redirecting_factory_body.dart (33 hints)
  • lib/src/fasta/kernel/transform_set_literals.dart (33 hints)
  • lib/src/fasta/source/scope_listener.dart (33 hints)
  • lib/src/fasta/crash.dart (32 hints)
  • lib/src/fasta/scanner/utf8_bytes_scanner.dart (32 hints)
  • lib/src/fasta/kernel/verifier.dart (31 hints)
  • lib/src/fasta/type_inference/standard_bounds.dart (31 hints)
  • lib/src/fasta/colors.dart (30 hints)
  • lib/src/compute_platform_binaries_location.dart (28 hints)
  • lib/src/fasta/builder/library_builder.dart (28 hints)
  • lib/src/api_unstable/bazel_worker.dart (26 hints)
  • lib/src/fasta/parser/type_info.dart (26 hints)
  • lib/src/fasta/source/source_class_builder.dart (26 hints)
  • lib/src/fasta/kernel/kernel_type_alias_builder.dart (25 hints)
  • lib/src/fasta/scanner/scanner_main.dart (25 hints)
  • lib/src/fasta/scanner/string_canonicalizer.dart (24 hints)
  • lib/src/fasta/builder/procedure_builder.dart (23 hints)
  • lib/src/fasta/testing/validating_instrumentation.dart (23 hints)
  • lib/src/fasta/scanner/recover.dart (22 hints)
  • lib/src/fasta/type_inference/type_constraint_gatherer.dart (22 hints)
  • lib/src/api_prototype/terminal_color_support.dart (21 hints)
  • lib/src/fasta/type_inference/type_schema_environment.dart (21 hints)
  • lib/src/fasta/identifiers.dart (20 hints)
  • lib/src/fasta/parser/token_stream_rewriter.dart (20 hints)
  • lib/src/fasta/parser/util.dart (20 hints)
  • lib/src/scanner/reader.dart (20 hints)
  • lib/src/fasta/scanner/string_scanner.dart (19 hints)
  • lib/src/kernel_generator_impl.dart (19 hints)
  • lib/src/fasta/builder/named_type_builder.dart (18 hints)
  • lib/src/fasta/parser/literal_entry_info_impl.dart (18 hints)
  • lib/src/fasta/dill/dill_loader.dart (17 hints)
  • lib/src/fasta/dill/dill_member_builder.dart (17 hints)
  • lib/src/fasta/kernel/kernel_function_type_builder.dart (17 hints)
  • lib/src/fasta/kernel/kernel_type_variable_builder.dart (17 hints)
  • lib/src/fasta/type_inference/type_promotion.dart (17 hints)
  • lib/src/fasta/builder/class_builder.dart (15 hints)
  • lib/src/fasta/kernel/kernel_named_type_builder.dart (15 hints)
  • lib/src/fasta/parser/modifier_context.dart (15 hints)
  • lib/src/base/libraries_specification.dart (14 hints)
  • lib/src/fasta/builder_graph.dart (14 hints)
  • lib/src/fasta/compiler_context.dart (14 hints)
  • lib/src/fasta/modifier.dart (14 hints)
  • lib/src/fasta/scanner.dart (14 hints)
  • lib/src/testing/compiler_common.dart (14 hints)
  • lib/src/api_prototype/memory_file_system.dart (13 hints)
  • lib/src/fasta/resolve_input_uri.dart (12 hints)
  • lib/src/fasta/severity.dart (12 hints)
  • lib/src/fasta/source/directive_listener.dart (12 hints)
  • lib/src/api_prototype/compiler_options.dart (11 hints)
  • lib/src/api_prototype/standard_file_system.dart (11 hints)
  • lib/src/api_unstable/dart2js.dart (11 hints)
  • lib/src/fasta/get_dependencies.dart (11 hints)
  • lib/src/fasta/kernel/kernel_builder.dart (11 hints)
  • lib/src/fasta/kernel/kernel_mixin_application_builder.dart (11 hints)
  • lib/src/fasta/scanner/io.dart (11 hints)
  • lib/src/fasta/builder/function_type_builder.dart (10 hints)
  • lib/src/fasta/builder/modifier_builder.dart (10 hints)
  • lib/src/fasta/kernel/load_library_builder.dart (10 hints)
  • lib/src/fasta/library_graph.dart (10 hints)
  • lib/src/fasta/parser/parser_main.dart (10 hints)
  • lib/src/fasta/type_inference/type_schema.dart (10 hints)
  • lib/src/fasta/type_inference/type_schema_elimination.dart (10 hints)
  • lib/src/fasta/builder/mixin_application_builder.dart (9 hints)
  • lib/src/fasta/dill/dill_type_alias_builder.dart (9 hints)
  • lib/src/fasta/kernel/implicit_field_type.dart (9 hints)
  • lib/src/fasta/kernel/implicit_type_argument.dart (9 hints)
  • lib/src/fasta/kernel/kernel_field_builder.dart (9 hints)
  • lib/src/fasta/builder/type_variable_builder.dart (8 hints)
  • lib/src/fasta/kernel/kernel_api.dart (8 hints)
  • lib/src/fasta/target_implementation.dart (8 hints)
  • lib/src/fasta/util/error_reporter_file_copier.dart (8 hints)
  • lib/src/fasta/builder/field_builder.dart (7 hints)
  • lib/src/fasta/builder/type_builder.dart (7 hints)
  • lib/src/api_prototype/incremental_kernel_generator.dart (6 hints)
  • lib/src/fasta/blacklisted_classes.dart (6 hints)
  • lib/src/fasta/builder/member_builder.dart (6 hints)
  • lib/src/fasta/kernel/kernel_formal_parameter_builder.dart (6 hints)
  • lib/src/fasta/parser.dart (6 hints)
  • lib/src/fasta/parser/recovery_listeners.dart (6 hints)
  • lib/src/fasta/type_inference/type_inference_engine.dart (6 hints)
  • lib/src/fasta/uri_translator.dart (6 hints)
  • lib/src/fasta/builder/formal_parameter_builder.dart (5 hints)
  • lib/src/fasta/builder/prefix_builder.dart (5 hints)
  • lib/src/fasta/dill/dill_target.dart (5 hints)
  • lib/src/fasta/import.dart (5 hints)
  • lib/src/fasta/kernel/kernel_variable_builder.dart (5 hints)
  • lib/src/fasta/ticker.dart (5 hints)
  • lib/src/api_prototype/experimental_flags.dart (4 hints)
  • lib/src/base/resolve_relative_uri.dart (4 hints)
  • lib/src/base/syntactic_entity.dart (4 hints)
  • lib/src/fasta/builder/builtin_type_builder.dart (4 hints)
  • lib/src/fasta/builder/declaration.dart (4 hints)
  • lib/src/fasta/builder/type_alias_builder.dart (4 hints)
  • lib/src/fasta/builder/type_declaration_builder.dart (4 hints)
  • lib/src/fasta/messages.dart (4 hints)
  • lib/src/fasta/parser/class_member_parser.dart (4 hints)
  • lib/src/fasta/problems.dart (4 hints)
  • lib/src/testing/package_root.dart (4 hints)
  • lib/src/external_state_snapshot.dart (3 hints)
  • lib/src/fasta/builder/constructor_reference_builder.dart (3 hints)
  • lib/src/fasta/builder/dynamic_type_builder.dart (3 hints)
  • lib/src/fasta/builder/void_type_builder.dart (3 hints)
  • lib/src/fasta/kernel/expression_generator_helper.dart (3 hints)
  • lib/src/fasta/kernel/inferred_type_visitor.dart (3 hints)
  • lib/src/fasta/kernel/kernel_invalid_type_builder.dart (3 hints)
  • lib/src/fasta/parser/literal_entry_info.dart (3 hints)
  • lib/src/fasta/util/bytes_sink.dart (3 hints)
  • lib/src/fasta/util/relativize.dart (3 hints)
  • lib/src/scanner/interner.dart (3 hints)
  • lib/src/api_prototype/kernel_generator.dart (2 hints)
  • lib/src/api_prototype/summary_generator.dart (2 hints)
  • lib/src/fasta/builder/invalid_type_builder.dart (2 hints)
  • lib/src/fasta/builder/metadata_builder.dart (2 hints)
  • lib/src/fasta/builder/unresolved_type.dart (2 hints)
  • lib/src/fasta/combinator.dart (2 hints)
  • lib/src/fasta/hybrid_file_system.dart (2 hints)
  • lib/src/fasta/kernel/forest.dart (2 hints)
  • lib/src/fasta/kernel/unlinked_scope.dart (2 hints)
  • lib/src/fasta/parser/parser_error.dart (2 hints)
  • lib/src/scheme_based_file_system.dart (2 hints)
  • lib/src/api_prototype/file_system.dart (1 hint)
  • lib/src/api_unstable/compiler_state.dart (1 hint)
  • lib/src/base/instrumentation.dart (1 hint)
  • lib/src/fasta/export.dart (1 hint)
  • lib/src/fasta/ignored_parser_errors.dart (1 hint)
  • lib/src/fasta/kernel/kernel_prefix_builder.dart (1 hint)
  • lib/src/fasta/kernel/kernel_type_builder.dart (1 hint)
  • lib/src/fasta/parser/assert.dart (1 hint)
  • lib/src/fasta/parser/directive_context.dart (1 hint)
  • lib/src/fasta/parser/error_delegation_listener.dart (1 hint)
  • lib/src/fasta/parser/forwarding_listener.dart (1 hint)
  • lib/src/fasta/parser/top_level_parser.dart (1 hint)
  • lib/src/fasta/source/diet_parser.dart (1 hint)
  • lib/src/scanner/string_utilities.dart (1 hint)

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (kernel).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0-dev.5.0 <3.0.0
kernel 0.3.16 0.3.16 0.3.29
package_config ^1.0.1 1.1.0
path ^1.3.9 1.6.4
yaml ^2.1.12 2.2.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
meta 1.1.8
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
analyzer 0.36.1
args >=0.13.0 <2.0.0 1.5.2
build_integration
dart_style ^1.0.7
json_rpc_2 ^2.0.9
test ^1.3.4
test_reflective_loader ^0.1.0
web_socket_channel ^1.0.4