Commit Graph

482 Commits

Author SHA1 Message Date
Brian Wilkerson 28785aa14d Define the getter Element.session
Change-Id: I467f69d48a3084c444446a785110a5db85b3ecfa
Reviewed-on: https://dart-review.googlesource.com/c/81332
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-26 13:47:32 +00:00
Brian Wilkerson 017e6b184b Add a utility to LibraryElement to access top-level elements without enumerating all of the compilation units (issue 34892)
Change-Id: If5bdc5da20bc0fb524c5f2db47ff46a87d511194
Reviewed-on: https://dart-review.googlesource.com/c/81185
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 22:25:57 +00:00
Brian Wilkerson 67b9f2ec8d Deprecate Element.unit and Element.computeNode
Change-Id: Id2a70b4a194cba28bfdc0990d7306d6561f422db
Reviewed-on: https://dart-review.googlesource.com/c/81060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 16:50:43 +00:00
Brian Wilkerson 5d78509e25 Make FieldElementImpl.isCovariant a public member on FieldElement
Change-Id: I5004f9a18c842a51fcb8901ece8bb7831d237a33
Reviewed-on: https://dart-review.googlesource.com/c/80261
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-16 15:58:46 +00:00
Brian Wilkerson 469e1e2e64 Remove unnecessary library directives
Change-Id: I7a157080e4d7fd80d64489a13de4e996b5870930
Reviewed-on: https://dart-review.googlesource.com/c/79474
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-13 00:44:04 +00:00
Paul Berry cc884b3449 Remove optional argument from FunctionTypeImpl.forTypedef.
It didn't work properly anyhow (see issue #34657).  Changed the call
sites to use GenericTypeAliasElementImpl.instantiate, which does have
the correct behavior.

Change-Id: I4b9c6cc8ddfcf3b0bebe40b7d874c4630c4b5ae4
Reviewed-on: https://dart-review.googlesource.com/c/79283
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-11 17:36:20 +00:00
Brian Wilkerson ba1b30af37 Add AST support for type arguments on named constructors
Change-Id: If64ec8db3cf63858ea2ff446118be34cd3c3c203
Reviewed-on: https://dart-review.googlesource.com/c/78870
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-09 22:19:16 +00:00
Paul Berry b3af151325 Rework detection of uninstantiated bound errors.
We now determine whether a type is simply bounded in the summary
linker, so that we can take advantage of the linker's circularity
detection logic.

Fixes #34635.
Fixes #34636.

Change-Id: I6c5040dbaeb79957d8a84e3f76e6a51834b57f05
Reviewed-on: https://dart-review.googlesource.com/c/78867
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-09 22:07:02 +00:00
Paul Berry 28780d34df Convert element.dart to triple-slash comment style.
Change-Id: I8af3b0fb06f10ffbc1b9fca6489d3e82ea77dcc6
Reviewed-on: https://dart-review.googlesource.com/c/78600
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-08 20:22:59 +00:00
Konstantin Shcheglov 80db08809c Pass InheritanceManager2 into resolver, use for BinaryExpression.
Ideally I think we should not use Expression.staticParameterElement to
get back to the corresponding parameter of the invoked FunctionType,
and do this check directly during resolution.

R=brianwilkerson@google.com

Change-Id: I6dbb5bf63f7eaad7f19b31129319e32dd4455acc
Reviewed-on: https://dart-review.googlesource.com/c/77641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 21:48:36 +00:00
Konstantin Shcheglov 4df3626d19 Remove support for (non)nullable types from Analyzer.
R=brianwilkerson@google.com

Change-Id: Ia26c203ed4fa238d1a546fe67e009fa542ed8f82
Reviewed-on: https://dart-review.googlesource.com/77666
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 20:05:15 +00:00
Brian Wilkerson 72d3798764 Improved completion support for mixins
Change-Id: I77aea1b03e00725c48458b0e6ee9b1936ea5685c
Reviewed-on: https://dart-review.googlesource.com/c/77661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 18:27:33 +00:00
Brian Wilkerson 6c577f0620 Deprecate Element.isVirtual
Change-Id: I987ba5fbe847c961d698692e0e8b6c98cdbfb30c
Reviewed-on: https://dart-review.googlesource.com/77230
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-29 15:43:43 +00:00
Konstantin Shcheglov 2455141018 Remove ClassElement.isSuperConstructorAccessible().
I don't see it used anywhere outside of Analyzer itself in internal
codebase. So, I think it is safe to remove.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If5dafdaaa0f94cf280822418d99ed64060b66d4b
Reviewed-on: https://dart-review.googlesource.com/75562
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-20 16:28:13 +00:00
Konstantin Shcheglov 81ce969060 Enable implicit constructors with optional parameters in mixin applications.
The spec changed in https://github.com/dart-lang/sdk/commit/63c6851dd01514e9d9e6cb96da0430e15b66d576

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34375
Change-Id: If7ba66d82fa4127cc6764d93f299790e8a862b42
Reviewed-on: https://dart-review.googlesource.com/75422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-19 16:12:21 +00:00
Paul Berry 02d1fc5ba8 Add a ClassOrMixinDeclaration class.
This will be needed for summary logic, since summaries use a common
data structure to implement classes and mixins.  It seems like it
should also be useful to clients.  Note that it's a
backwards-compatible change in terms of the anaylzer API.

Change-Id: Id8e376f36a187578bd924bcf759c7384e5e96ce1
Reviewed-on: https://dart-review.googlesource.com/74326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-11 17:31:12 +00:00
Konstantin Shcheglov c29ec5994c Resolve super invocations in mixin declarations.
R=brianwilkerson@google.com

Change-Id: I81dddc8187a13a17db91f77dc0df19248db7d45b
Reviewed-on: https://dart-review.googlesource.com/74007
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-07 20:06:21 +00:00
Konstantin Shcheglov e96652352d Resolve mixin declarations.
Errors for onClause are not correct yet, and not tested yet.

R=brianwilkerson@google.com

Change-Id: I9a1f2b4734661baac85a9d1b9311d21104c7c495
Reviewed-on: https://dart-review.googlesource.com/72360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-31 16:11:21 +00:00
Konstantin Shcheglov d659022f08 Build elements for MixinDeclaration(s).
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ica9912b795bbdfeea2dd46130e30bde3bdc4cef3
Reviewed-on: https://dart-review.googlesource.com/72067
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 21:05:35 +00:00
Konstantin Shcheglov 9c642328ac Summarize mixin declarations.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I2aecbe4e3c5548a8034c51191f58eaf3439b9d76
Reviewed-on: https://dart-review.googlesource.com/71928
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 19:08:56 +00:00
Konstantin Shcheglov 1f52372bfa Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 13:46:45 +00:00
Sam Rawlins ff3908d6df Implement INVALID_SEALED_ANNOTATION analyzer Hint
This follows the pattern of other meta-annotations, when it comes to the AST:

* Element gains a new `hasSealed` getter. Many overrides.
* ElementAnnotation gains a new `isSealed` getter.

Bug: https://github.com/dart-lang/sdk/issues/34232
Change-Id: If8ae8e16b500125cb3b92b3cf83d46de6ca6ee23
Reviewed-on: https://dart-review.googlesource.com/71227
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 22:03:22 +00:00
Brian Wilkerson b8ee603eb2 Deprecate the EMPTY_LIST constants in analyzer
Change-Id: I4c85c8c21207c86003cdb47d499ae9a934606889
Reviewed-on: https://dart-review.googlesource.com/71234
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 14:32:20 +00:00
Brian Wilkerson de3570d8bd Add support for the new mixin feature to the element model
Change-Id: I99344c387c4138438d3d7390bfce15b12e0073ab
Reviewed-on: https://dart-review.googlesource.com/71221
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-23 00:19:06 +00:00
Brian Wilkerson 8b125b55d0 Add an AST structure for the new mix-in support
Change-Id: I3d8890edf26eeb19eaaab9c27772e2c37c10e629
Reviewed-on: https://dart-review.googlesource.com/70141
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-08-21 16:39:41 +00:00
Sam Rawlins 7818db20a7 Add analysis hint for invalid use of @visibleForTemplate code.
Bug: https://github.com/dart-lang/sdk/issues/33353
Change-Id: Iaafccc3dca6b8d87bd54ed721871c72e9ac456c8
Reviewed-on: https://dart-review.googlesource.com/68432
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 16:51:45 +00:00
Brian Wilkerson 87f753dbd3 Replace some declarations of element with declaredElement
Change-Id: Idd62472b16cccaa98749a510197ec8d0f5053cb1
Reviewed-on: https://dart-review.googlesource.com/67820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-02 16:00:36 +00:00
Brian Wilkerson 55880dfeed Add support in the new API for CFE
Change-Id: I4e7a12b786a8774e92dd96a5f94d86e1d1a3564e
Reviewed-on: https://dart-review.googlesource.com/67701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-01 04:24:28 +00:00
Brian Wilkerson 2e7b0a13f1 Add support for accessing all of the created contexts
Change-Id: I84284726dea1b12f8403456cbdb0a9a967624e0d
Reviewed-on: https://dart-review.googlesource.com/67380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-30 17:47:12 +00:00
Brian Wilkerson be7717dab4 Deprecate more propagated info members
Change-Id: I65555bad9f1087602b7bdb5ae41a3920c23d143d
Reviewed-on: https://dart-review.googlesource.com/66500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-25 13:17:23 +00:00
Brian Wilkerson 54e241d71f Deprecate more AST API and replace uses of it
Change-Id: I6ecf17853915e4b61ee39f25d99451b78d2ba4ac
Reviewed-on: https://dart-review.googlesource.com/66401
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-24 15:51:18 +00:00
Brian Wilkerson e98334a58c Remove remaining references to propagated types and mark the members as deprecated
Change-Id: I2508bc7d6afb36a42e33f0e421f3a39f6d8b4d02
Reviewed-on: https://dart-review.googlesource.com/66142
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-22 23:47:01 +00:00
Brian Wilkerson cd71a2f84b Remove references to propagated types from some tests
Change-Id: I8042b9edaa1485e028a281dfb342268e04e899b5
Reviewed-on: https://dart-review.googlesource.com/66141
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-22 20:06:29 +00:00
Mike Fairhurst ff2933c55b Fix #33194, handle type parameters on implicit call tearoffs.
Bug: 33194
Change-Id: Iecf3d2bdf1dcd1a05ef128f10cd2fa374f9b47ca
Reviewed-on: https://dart-review.googlesource.com/64822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-07-15 00:48:06 +00:00
Paul Berry 9179db84df Resynthesize typedef types properly from kernel.
I broke this functionality when I refactored FunctionTypeImpl into
lazy and strict variants; this CL restores it and simplifies it.

This CL also adds a new method to the analyzer API:
FunctionTypeAliasElement.instantiate(), to allow a client to supply
type arguments to a typedef (as one would at a site where the typedef
is used), to produce a type.  Putting the method in
FunctionTypeAliasElement helps move us toward an API that
distinguishes type "constructors" from types (a generic typedef
defines not just one type but a family of types; to obtain a type one
must instantiate the typedef by supplying type arguments).

Change-Id: I722db2befe2d54fd53d625ddba0dec856a555a7b
Reviewed-on: https://dart-review.googlesource.com/62282
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-06-26 23:32:48 +00:00
Sam Rawlins ed0ba901e1 Doc - Fix library links in analyzer docs
These new links are stil brittle; if dartdoc changes the paths of libraries, or
if `element.dart` gets a `library` directive. But at least they're fixed. There
doesn't appear to be a less brittle solution.

Bug: https://github.com/dart-lang/sdk/issues/27994
Change-Id: Ibff7c01442d10e7133e68500219ac9a5713888b2
Reviewed-on: https://dart-review.googlesource.com/61913
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-06-22 18:40:05 +00:00
Konstantin Shcheglov 493c421f0d Add AnalysisContextCollection.
R=brianwilkerson@google.com

Change-Id: Id0c64648983129f5ecd46d784e978ce321ba2041
Reviewed-on: https://dart-review.googlesource.com/60404
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-06-18 15:53:36 +00:00
Konstantin Shcheglov a9fef15ff3 Add FileResult and AnalysisDriver.getFileSync().
I thought that getSourceKind() might be not the best API. We are moving
away from Source, and it seems that we should stop using SourceKind as well.

R=brianwilkerson@google.com

Change-Id: I0fcff8dc8cefcd6d8fb899badab8037bf8d67775
Reviewed-on: https://dart-review.googlesource.com/58442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-06-05 20:51:37 +00:00
Brian Wilkerson 1f03109200 Proposed replacement for SourceFactory
Change-Id: Iadcb71a4f9682d4cb9636aea6bb0b91f3bf040f9
Reviewed-on: https://dart-review.googlesource.com/58160
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-06-05 16:09:49 +00:00
Konstantin Shcheglov f32509b849 Export 'resourceProvider' from AnalysisSession.
R=brianwilkerson@google.com

Change-Id: I0544be022a078f96be23c4e75923c32f70385589
Reviewed-on: https://dart-review.googlesource.com/55443
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-16 17:28:16 +00:00
Konstantin Shcheglov 8515d74332 Add ImportElement.namespace and use it in completion.
R=brianwilkerson@google.com

Change-Id: I58cadf0e3239ad4ae8584d79485f4d9ebda10eba
Reviewed-on: https://dart-review.googlesource.com/54064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-07 21:23:48 +00:00
Konstantin Shcheglov b7a63c8d52 Use @isTest and @isTestGroup to understand executable element as a test/group.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2055
Change-Id: I7c8e7639d111eca63df0780ebdec182573493047
Reviewed-on: https://dart-review.googlesource.com/53690
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-04 17:09:06 +00:00
Brian Wilkerson cb15b43c32 Add support for getting parse results synchronously
Change-Id: I2a6c4507fcc6debf3d4ffc3458621100d184619b
Reviewed-on: https://dart-review.googlesource.com/52820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-26 20:24:46 +00:00
Brian Wilkerson a865531f57 Remove two unused classes from the public API
Change-Id: I4d27bc95d3a3e0ffc3ad379ffd823abf4fff0db1
Reviewed-on: https://dart-review.googlesource.com/51244
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-16 19:15:29 +00:00
Brian Wilkerson dd897d35a2 Move the task API out of the public API
Change-Id: I0fbafb4965ced89fb9a063edb773c3f1cb3a39fa
Reviewed-on: https://dart-review.googlesource.com/51242
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-16 18:18:08 +00:00
Brian Wilkerson 98671b2659 Make DeclaredVariables immutable
Change-Id: I3d0233cfb4002140af7cf0166cd98466d73d630c
Reviewed-on: https://dart-review.googlesource.com/50580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-11 01:58:51 +00:00
Brian Wilkerson 8054721512 Move DeclaredVariables to a better location
Change-Id: I17190a8e888cc37cded141cbaf028691db061e49
Reviewed-on: https://dart-review.googlesource.com/50540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-10 19:25:11 +00:00
Brian Wilkerson 7764e6962e Initial API to build analysis contexts (replaces ContextLocator.locateContexts)
Change-Id: If00ce6321efb6ff4da96e654cfe2a0a8501bed95
Reviewed-on: https://dart-review.googlesource.com/50323
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-10 15:48:10 +00:00
Brian Wilkerson 8d78982c3f Move file system access support from AnalysisContext to ContextRoot
Change-Id: Ic9097b8852e578001cc6555bcd4d8a94a1fde08d
Reviewed-on: https://dart-review.googlesource.com/49041
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-02 22:16:25 +00:00
danrubel b82e5b4704 Replace code completion usage of token.previous with findPrevious
This CL is the first in a multi-part effort to remove the `previous`
field from the Token class. This first step introduces a new findPrevious
utility method that finds the the token before a given token in a token stream,
and then replaces usages of token.previous with calls to this
new findPrevious utility.

Change-Id: I57de4e542adb5950f1bddd951ff555dd98b19b3b
Reviewed-on: https://dart-review.googlesource.com/48461
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-28 02:27:54 +00:00