Similar to earlier work that reworked parsing of variable declarations,
this CL reworks parsing of local constant declarations to use
TypeInfo rather than parseType. This simplifies and improves recovery,
and reduces the number of error messages in some recovery situations.
Change-Id: I32705bdba20a0cb7aee41c64510c4c2896a5ae68
Reviewed-on: https://dart-review.googlesource.com/47241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Long ago I accidentally only made the change to _cfe.dart in the .json file and
not in the .yaml file (which is technically the source of truth).
Change-Id: I0e8abdc84b9b0f20019c712246493979debaf1cd
Reviewed-on: https://dart-review.googlesource.com/47323
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Only a widget creation expression can be extracted.
Not exposed through Analysis Server API.
R=brianwilkerson@google.com, devoncarew@google.com
Change-Id: I6a47cc1851d69b54a2812bd6a5320c287d5b9eae
Reviewed-on: https://dart-review.googlesource.com/47360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
* fix for `invariant_booleans` when analyzing for loops with no condition
* new `avoid_types_as_parameter_names` lint
* new `avoid_renaming_method_parameters` lint
Change-Id: Iaafceba24f1b049a132464b78588d57e621c85d4
Reviewed-on: https://dart-review.googlesource.com/47300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I99758d562e0140095d8f539419da9a98a55e6132
Reviewed-on: https://dart-review.googlesource.com/46941
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This CL reworks parsing local variable and local function
declarations to improve recovery and error messages.
In addition, the fasta parser properly parses metadata
before a local function declaration.
Change-Id: Ia43c8bab3f3ce3b824390a4aa36d50b85f1ea9af
Reviewed-on: https://dart-review.googlesource.com/46952
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This comes up for dart2js when the location for dart2js_platform.dill is invalid
or when the file was not provided. Today dart2js produces a bad crash message in
that scenario, instead of a readable error.
I wanted to provide a better message, but I'm not sure I can. For example, I
wanted to say "SDK Platform file not found", but I can't because linked
dependencies can be used for other puposes.
Change-Id: I1739ec36dab16b2fd72552e5e7716cd573a8ebd0
Reviewed-on: https://dart-review.googlesource.com/46943
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Also refactors the code to make this sort of issue less likely.
Change-Id: Iff72e53720ba78e84c3d219e69ccd0d6a47c09a0
Reviewed-on: https://dart-review.googlesource.com/47188
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
I need something similar for Extract Widget refactoring - get references
to some Flutter types, which are probably already available from the
resolved unit.
R=brianwilkerson@google.com
Change-Id: I8d9a9e6c35c9fe7ef8fba6547c560642f650d018
Reviewed-on: https://dart-review.googlesource.com/47184
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Pub still uses the old API to provide inputs. Source files are provided as
String, which were were incorrectly provided as codeunits. The FE expected the
binary input to be utf8 encoded.
As a separate follow up, I can update pub to provide binary data directly, or
even move it to use the new API instead so we can delete the old API soon.
Because pub-build is being replaced, I'm inclined to only do a small fix there.
Closes#32561
Bug= dartbug.com/32561
R=johnniwinther@google.com
Change-Id: I69d9ac896d534427a918ded721ee946aa5c0fc34
Reviewed-on: https://dart-review.googlesource.com/46945
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Add Dart_IsSnapshot and Dart_IsKernel to the embedding API.
Change-Id: I7d4e1d145557e8f11dbc3c143767ad38b3615a4a
Reviewed-on: https://dart-review.googlesource.com/46360
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Add tests.
Change-Id: If27b6c987c944ebb84d43acde012f5b44730c4e7
Reviewed-on: https://dart-review.googlesource.com/45501
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Change-Id: I84223c57dcbc74d9e5ba7d2d977fe9d5f6d686dc
Reviewed-on: https://dart-review.googlesource.com/46900
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: William Hesse <whesse@google.com>