This CL updates fasta parsing of `for` statements
to detect additional errors and improve recovery.
The parser originally called parseType when parsing `for` statements
which committed the parser down a particular path
and limited the ability of the caller to gracefully recovery.
Now the parser calls computeType, which parses and caches
the type information, so that the caller has more opportunity
to recover gracefully.
Change-Id: I6296ffb1f75e77a87a7533bfca77dae18cfcf60d
Reviewed-on: https://dart-review.googlesource.com/46383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This updates the AstBuilder and OutlineBuilder
to generate the following errors:
* ConstConstructorWithBody
* ConstMethod
* ConstructorWithReturnType
* FieldInitializerOutsideConstructor
In order to get the necessary state in OutlineBuilder so that I could
report these errors, I extracted SourceLibraryBuilder.addConstructor
from addProcedure.
In addition, I updated AstBuilder to use handleRecoverableError
rather than parser.reportRecoverableError.
Change-Id: I8b5517ec2ab44ff13a65628c594f803138cad6f5
Reviewed-on: https://dart-review.googlesource.com/43800
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This refactors how modifiers are passed to listener so that the
OutlineBuilder can report a static constructor error.
* Remove handleModifier/s calls from parseMethod
* Pass name and modifiers in beginMethod event
* Update listeners to process method modifiers in beginMethod event
* AstBuilder
* NodeListener
* OutlineBuilder
* Address comment in https://dart-review.googlesource.com/c/sdk/+/42800
Change-Id: Iabd4a18613c1814eb5a157df4acf60dd9060d5eb
Reviewed-on: https://dart-review.googlesource.com/43120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This takes the compile-time errors from dartk strong mode, and provisionally
puts them in a $fasta section, and puts the run-time errors into a
$compiler == dartk && $strong section. None of them are triaged,
many of them may be errors in the tests, not in fasta.
Change-Id: I71f0cf46584754e9f72005b1d8a2f6b7b3553026
Reviewed-on: https://dart-review.googlesource.com/38122
Reviewed-by: Peter von der Ahé <ahe@google.com>
This is a branch of co19 tests where the tests have been
made strong mode compliant. A co19_2_analyzer.status file
has been added with the current statuses of the tests when
run on dartanalyzer --strong. We expect more Dart 2 configurations
to start running these tests and adding status files.
Change-Id: I22077272707620b92dd1092c38bbb4f3d5964493
Reviewed-on: https://dart-review.googlesource.com/37743
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>