Commit Graph

9 Commits

Author SHA1 Message Date
Parker Lougheed 2a98f98098 [scrape] Use dart_flutter_team_lints as base for analysis
Change-Id: Ief30fb79b2afcbb3f50d9127eb622fac362b07b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340141
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2023-12-07 17:57:31 +00:00
Robert Nystrom dd26d7875f Add a few tweaks to the scrape package.
- Create histograms automatically so that you can just call record()
  and it will work even if you didn't pre-define the histogram.

- Expose an API for printing a range of lines.

- Expose the source code being parsed.

Change-Id: I486f75c75451871778ffe24389633f4c7d8c7736
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340024
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-12-06 02:39:38 +00:00
Robert Nystrom 9057fcbc11 Couple of tweaks to the scrape package.
- Trim output lines to 80 characters. This makes it overwrite the line
  correctly instead of scrolling unnecessarily.

- Make the tokens for each parsed file available to a scrape class.

Change-Id: Ib986ec548ac3f8ba1c3c55b1a00673f49d45c0d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280055
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-02-01 22:40:38 +00:00
Konstantin Shcheglov 01173e2aa2 Deprecate 'name' in AST, use 'name2' token instead.
Change-Id: I867f009dca12208f835199297d2ea85c203c8556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252566
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-02 16:25:34 +00:00
Carolyn Qu 21b07646f5 Fixing typo in comment
Change-Id: I3a64ee58f2d3d5c23492c799a8cf50876fe8b4a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246987
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Carolyn Qu <carolynqu@google.com>
Commit-Queue: Islina Shan <islinashan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Islina Shan <islinashan@google.com>
2022-06-04 00:35:16 +00:00
Robert Nystrom dcec42f0b5 Add script to scrape metadata annotation arguments.
Change-Id: Icbe5c84cfa5cb2fe376679b267452d6dcfe61ac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206582
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-07-12 23:41:32 +00:00
Robert Nystrom 86ccb1fb6e Migrate pkg/scrape to null safety.
Change-Id: I5c9857090eed7bf521ba581d0c9051606ed45304
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205940
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2021-07-07 22:08:53 +00:00
Robert Nystrom c755ef4ac6 Fix some error handling in scrape.
- Ensure the lexer is running at the latest language version. Before, it
  would fail to handle files that used extension methods since it didn't
  tokenize "extension" correctly.

- Don't visit files that produce parse errors. It was reporting the
  errors but still going ahead and parsing them... which actually
  worked surprisingly well (yay error recovery) but could lead to
  dubious results.

Change-Id: I0e94b5c56efaeb3c2ccde0fbf20c09733aac4998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174021
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2020-11-30 15:19:30 +00:00
Robert Nystrom 891a8a1aa3 Add new "scrape" package.
The README explains, it but, in short, this is a little library I
harvested from the scripts I wrote during ui-as-code. It makes it easier
to write scripts to gather bits of statistical data from Dart syntax.

Change-Id: Ia33797f582c4d4f9f966b7f6dc7b58ca2414601e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166788
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-10-19 22:24:28 +00:00