mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:07:49 +00:00
0b93c279e7
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 . |
||
---|---|---|
.. | ||
example/incremental_reload | ||
lib | ||
test | ||
testcases | ||
tool | ||
analysis_options.yaml | ||
BUILD.gn | ||
LICENSE | ||
messages.yaml | ||
pubspec.yaml | ||
README.md | ||
testing.json |
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.