Commit Graph

7 Commits

Author SHA1 Message Date
Konstantin Shcheglov 3d67e6f998 Migrate _fe_analyzer_shared to null safety.
Some notes.

1. `Token.next` is `Token?` because there are null(s) for comment tokens.
  But I think that it is never `null` in code, because there is at
  least EOF token. So, lots of `!` null checks.

2. `Link.tail` is never null when `isNotEmpty`, but the type system
  cannot express it. So, some number of `!` null checks.

3. I keep assert(s) for now, and use comment
  `// ignore: unnecessary_null_comparison`.

4. I disabled `can_get_rid_of_nnbd_issue_error`, I think it fails
  because of changes in `_fe_analyzer_shared` language version.

Smoke test in google3 looks green.
https://test.corp.google.com/ui#id=OCL:346825148:BASE:346841611:1607632317129:6e87bf7

I have not tried yet full TAP, will do in the evening.

I have not tried yet Golem, or looked at benchmarks.

Change-Id: I651301e5d3a851dd77d73af960dac779cb0fc991
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-12-12 03:22:29 +00:00
Johnni Winther dc97454b63 [analyzer,cfe,dart2js] Add pretty printing to id testing
Adds support for pretty printing verbose annotations.
Adds support for force updating annotation texts useful for applying
the pretty printing to valid annotations.

Change-Id: I8fe9b6d2f8198bd5e160854053c8d964ef832a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129710
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-14 13:24:09 +00:00
Johnni Winther 84c2a50aa0 [analyzer,cfe,dart2js] An indices to annotations preserve original order in id_generation
Change-Id: I0894baa6771b1c5a11a33007feebd1886aea032d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130704
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-10 11:51:17 +00:00
Paul Berry 721670fc2d Stop using package:expect in _fe_analyzer_shared.
_fe_analyzer_shared is published on pub so it isn't appropriate for it
to use package:expect (which isn't published at all).  All we were
using it for was a few string equality checks; simply using operator==
and throwing an exception is an adequate replacement.

If, in the future, we decide that we really need the additional
functionality provided by package:expect, we can always convert the
test to use package:test, and then make use of the `expect` method
provided by package:test.

Partially addresses https://github.com/dart-lang/sdk/issues/40007.

Change-Id: Ib7827db0cdb480feacc454a3aa660ea4c6e7cfd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130623
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-08 16:28:50 +00:00
Johnni Winther d2fcd678fd [analyzer,cfe,dart2js] Improve offset of generated library/class/member annotations
Change-Id: I76fea5f3479b5185433ec56efefb89071676e1a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130375
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-08 14:47:28 +00:00
Johnni Winther 969fa962da [analyzer,cfe,dart2js] Do not generate annotations for empty values.
Change-Id: I0efa6287a44e340f9dc242b4ffc84fc8723e1049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129718
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-03 20:12:39 +00:00
Johnni Winther e3a20bf361 [analyzer,cfe,dart2js] Support annotated code generation
Add support for generating annotations from actual data using
option -g

Change-Id: I88d9cdb62a38d579234b15097c9e9bb3d81ebe8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129708
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-03 13:57:39 +00:00