dart-sdk/pkg/front_end
Dan Rubel 0b93c279e7 improve fasta closing brace recovery
Currently, fasta synthetically closes open braces until it finds
a match for the current closing brace. This works most of the time,
but provides less than optimal recovery in some common cases.
For example, given the following

class { foo()){print(a);} var a = 'hello'; }

the current brace recovery method fails to find any match for the
second closing parenthesis and synthetically closes the class
causing the rest of the file to be parsed as outside the class.

With this CL, fasta still synthetically closes open braces when it finds
a match for the current closing brace, but if there is no match, then
it just skips over the extra closer and continues. This approach dramatically
improves recovery in many cases where there is an extra closing parenthesis
or extra closing square bracket. In the example above, fasta parses
everything after the second closing parenthesis inside the class.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2981343002 .
2017-07-26 10:37:19 -04:00
..
example/incremental_reload Fix incremental_reload example after VmReloader -> RemoteVm rename. 2017-07-11 12:11:58 -07:00
lib improve fasta closing brace recovery 2017-07-26 10:37:19 -04:00
test improve fasta closing brace recovery 2017-07-26 10:37:19 -04:00
testcases Implement AstBuilder integration for method/function invocations. 2017-07-21 10:47:25 -07:00
tool Random improvements in error reporting. 2017-07-19 10:45:31 -07:00
analysis_options.yaml Move kernel baseline tests to front_end. 2017-04-19 10:57:58 +02:00
BUILD.gn Disable analysis on a few packages. (#29571) 2017-05-05 22:06:00 -07:00
LICENSE Create a README and pubspec for the front_end package. 2016-10-19 12:14:38 -07:00
messages.yaml Random improvements in error reporting. 2017-07-19 10:45:31 -07:00
pubspec.yaml Replace typed_mock with mockito in front_end. 2017-07-24 11:46:18 -07:00
README.md Prepare package:analyzer 0.30.0. 2017-05-03 14:34:55 -07:00
testing.json Remove the "kompile" mode of running the front end. 2017-07-13 10:52:55 -07:00

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.