Commit Graph

124 Commits

Author SHA1 Message Date
Dan Rubel 48093f5f9d Revert "Add support for parsing simple nullable types"
This reverts commit c5fd11b5d6.

Reason for revert: Conditional expression lookahead may modify the token stream

Original change's description:
> Add support for parsing simple nullable types
> 
> ... as part of adding NNBD as outlined in
> https://github.com/dart-lang/language/issues/110
> 
> This only supports parsing simple nullable types
> such as int? and List<int>? while subsequent CLs
> will add support for parsing more complex types.
> 
> Change-Id: I144858946cb115755af437299899c2631105bf8c
> Reviewed-on: https://dart-review.googlesource.com/c/87501
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Dan Rubel <danrubel@google.com>

TBR=brianwilkerson@google.com,danrubel@google.com

Change-Id: Ie1f47e7384ff51159aa2ebeb21561455b8e6287f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/87620
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-18 14:32:33 +00:00
danrubel c5fd11b5d6 Add support for parsing simple nullable types
... as part of adding NNBD as outlined in
https://github.com/dart-lang/language/issues/110

This only supports parsing simple nullable types
such as int? and List<int>? while subsequent CLs
will add support for parsing more complex types.

Change-Id: I144858946cb115755af437299899c2631105bf8c
Reviewed-on: https://dart-review.googlesource.com/c/87501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-18 11:29:33 +00:00
danrubel 9de66d87b8 Revert support for parsing simple nullable types
This reverts commit bc8c7cf782

Reason for revert: Breaks parsing less common conditionals (e.g. b ? c = true : g();)

Original change's description:
> Add support for parsing simple nullable types
>
> ... as part of adding NNBD as outlined in
> https://github.com/dart-lang/language/issues/110
>
> This only supports parsing simple nullable types
> such as int? and List<int>? while subsequent CLs
> will add support for parsing more complex types.

Change-Id: I49a21a85dca19241e3b23ed5c9fb6084e70f2000
Reviewed-on: https://dart-review.googlesource.com/c/87284
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-14 18:47:42 +00:00
danrubel e2007126eb Revert support for simple nullable type return value in generalized function type
This reverts commit 11d081d115

Reason for revert: Breaks parsing less common conditionals (e.g. b ? c = true : g();)

Original change's description:
> Add support for simple nullable type return value in generalized function type
>
> This only supports nullable return values of the form
>
> <identifier> '?' 'Function' '(' ...
>
> This is an increment CL in the ongoing effort to add nullable type support
> as outlined in https://github.com/dart-lang/language/issues/110

Change-Id: I99bce29619d4e448193e3c81fa86a982791b1f77
Reviewed-on: https://dart-review.googlesource.com/c/87283
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-12-14 16:48:18 +00:00
Dan Rubel 6376482e20 Revert "Add support for prefixed nullable type"
This reverts commit 7720689931.

Reason for revert: Breaks parsing less common conditionals (e.g. b ? c = true : g();)

Original change's description:
> Add support for prefixed nullable type
> 
> This adds support for nullable types of the form
> 
> <identifier> '.' <identifier> '?'
> 
> and
> 
> <identifier> '.' <identifier> '?' 'Function' '(' ...
> 
> This is an increment CL in the ongoing effort to add nullable type support
> as outlined in https://github.com/dart-lang/language/issues/110
> 
> Change-Id: I526aecbe64bacbd442cea0b4c52d36ff23b0443b
> Reviewed-on: https://dart-review.googlesource.com/c/87083
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Dan Rubel <danrubel@google.com>

TBR=brianwilkerson@google.com,danrubel@google.com

Change-Id: Ib5e74b4aad239f561a33eae9d95dffa2693037f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/87282
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-14 15:12:51 +00:00
danrubel 7720689931 Add support for prefixed nullable type
This adds support for nullable types of the form

<identifier> '.' <identifier> '?'

and

<identifier> '.' <identifier> '?' 'Function' '(' ...

This is an increment CL in the ongoing effort to add nullable type support
as outlined in https://github.com/dart-lang/language/issues/110

Change-Id: I526aecbe64bacbd442cea0b4c52d36ff23b0443b
Reviewed-on: https://dart-review.googlesource.com/c/87083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-13 23:24:04 +00:00
Dan Rubel 11d081d115 Add support for simple nullable type return value in generalized function type
This only supports nullable return values of the form

<identifier> '?' 'Function' '(' ...

This is an increment CL in the ongoing effort to add nullable type support
as outlined in https://github.com/dart-lang/language/issues/110

Change-Id: I42febae9f88f7e4d8b05907988deab97c7a7425c
Reviewed-on: https://dart-review.googlesource.com/c/87081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-12 19:13:24 +00:00
Dan Rubel 1ff82c5081 Update endFunctionType event to take questionMark token
... which in this CL will always null.
This is another step when adding NNDB support as outlined in
https://github.com/dart-lang/language/issues/110

Change-Id: I3974fcb885c63be4af9d1007258383f3f8191ae0
Reviewed-on: https://dart-review.googlesource.com/c/87080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-12 16:10:23 +00:00
Dan Rubel bc8c7cf782 Add support for parsing simple nullable types
... as part of adding NNBD as outlined in
https://github.com/dart-lang/language/issues/110

This only supports parsing simple nullable types
such as int? and List<int>? while subsequent CLs
will add support for parsing more complex types.

Change-Id: I3cc5c65d20bf3732a39cab0e823b2f7332342866
Reviewed-on: https://dart-review.googlesource.com/c/86961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-11 23:48:04 +00:00
danrubel 2a85a3433e Update handleType event to take questionMark token
... which in this CL will always null.
This is the first step when adding NNDB support as outlined in
https://github.com/dart-lang/language/issues/110

Change-Id: If3810bcaf1b73e70924f09d619e2a84e7d5ba8d6
Reviewed-on: https://dart-review.googlesource.com/c/86860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-11 16:21:05 +00:00
danrubel 52892f7c47 Add scanner and parser support for new >>> operator
This adds support for the new >>> operator as detailed in
https://github.com/dart-lang/language/blob/master/accepted/future-releases/constant-update-2018/feature-specification.md#new-operators

Tracking issue: https://github.com/dart-lang/language/issues/60

Enable support by setting AbstractScanner.enableGtGtGt = true

Change-Id: I8e7d2fb341971452d8e05d734a1de612880fef5e
Reviewed-on: https://dart-review.googlesource.com/c/85421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-26 22:12:25 +00:00
Dan Rubel 737f44a8dd Add type argument count to type info in fasta parser
This adds a new accessor in the fasta parser support classes
for determining the number of type arguments. This will be used
when adding support for set literals to disambiguate a set literal
from a map literal.

Change-Id: If32c12d198f6d88fb06527817cec038c22428d53
Reviewed-on: https://dart-review.googlesource.com/c/84461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-14 22:36:43 +00:00
Peter von der Ahé f882af1c33 Include file name in scanner test chain
Change-Id: Ifca81ba39d14895cbe025f349d97a02e6b07856f
Reviewed-on: https://dart-review.googlesource.com/c/82994
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-11-06 13:18:40 +00:00
danrubel 9f7ad8d082 Fix recovery when parsing complex type variables
This fixes parser recovery when the user has inserted a word before
a method declaration with a complex type arguments, such as

  foo Future<List<int>> bar() {}

Fix https://github.com/dart-lang/sdk/issues/34850

Change-Id: Ic6d1767668bd34d75c6ab5f9973e5762bdd8f160
Reviewed-on: https://dart-review.googlesource.com/c/80780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-19 18:56:09 +00:00
Dan Rubel 05ba85399f Cleanup fasta parser rewriter insert token methods
Change-Id: Ic776cae52cbfae4c1892884a6d9e179147c5396e
Reviewed-on: https://dart-review.googlesource.com/75760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-20 17:00:41 +00:00
Dan Rubel 49da026e3e Report error for extends void type parameters
Change-Id: I634b836ea40199a1e7962b7d07ca9f5d1ef3f16a
Reviewed-on: https://dart-review.googlesource.com/74680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-13 20:27:56 +00:00
danrubel d35c18999f Disallow type parameters of the form <X super Y>
Fix https://github.com/dart-lang/sdk/issues/28848

Change-Id: I1b8cd943b5af448fb6f5826d002d0b5a403e6bba
Reviewed-on: https://dart-review.googlesource.com/74241
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 15:30:03 +00:00
Peter von der Ahé f5f33776a4 Revert "Store code ranges for formal parameters."
This reverts commit 5b9a42de29.

Change-Id: If6b3edc7194fda050de3b6ffbb0c8124a75509a6
Reviewed-on: https://dart-review.googlesource.com/72100
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-08-30 10:20:18 +00:00
Konstantin Shcheglov 5b9a42de29 Store code ranges for formal parameters.
Change-Id: I022e5140869c7007c28109a4dfda3914b34c4725
Reviewed-on: https://dart-review.googlesource.com/71184
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-22 17:40:58 +00:00
Dan Rubel ad6029c608 Update fasta parser to split ">>=" when parsing type var
Change-Id: Id60da00165ef1c7d9128985ccadef06f62637a24
Reviewed-on: https://dart-review.googlesource.com/70181
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-16 01:04:46 +00:00
Dan Rubel 4eb4d75270 Remove unused event parameter
Change-Id: I097886cae93204d671a3aca4caaafea8d117989d
Reviewed-on: https://dart-review.googlesource.com/70180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-16 01:04:46 +00:00
Dan Rubel 825df975a0 Revise fasta type arg/param parsing to ignore "<".endGroup
The scanner associates '<' with '>' and '>>',
but the parser cannot use '<'.endToken/endGroup reliably
and wastes time updating that token's endToken/endGroup field.

This CL updates type info parsing to ignore '<'.endGroup
and step through the token stream (which it has to do anyway),
for improved parsing.

This CL causes a handful of existing tests to fail (marked as @failingTest)
and test failures will be addressed in a subsequent CL.

Change-Id: I788e9a74cd2891f98f44bba15d5669febfec6c64
Reviewed-on: https://dart-review.googlesource.com/70001
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 22:16:40 +00:00
Dan Rubel 9619e2cd77 Remove unused fasta parser methods and event parameter
Change-Id: I0bf050a475ad3548342307027d14aba4badf468e
Reviewed-on: https://dart-review.googlesource.com/69620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-13 16:42:12 +00:00
danrubel c3f5c07a47 Simple type argument parsing fixes and more tests
This fixes some of the event tokens when parsing simple type arguments
with '>>' or '>=', and organizes and adds more tests.
In addition, this addresses a comment in
https://dart-review.googlesource.com/c/sdk/+/69261

Change-Id: I16e3a5360ac2e62dd1853df946b88611ff099d94
Reviewed-on: https://dart-review.googlesource.com/69360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-10 18:58:32 +00:00
danrubel 8e2141f1cf Fix parsing typedefs with <T>=
This is the first CL of several needed to fix typedef parsing
when there is no space between the type parameters and the `=`.

  typedef F<T>= T Function(T);

* Fix some typedef parsing failures
* Add new consts for simple type var ending with ">>" and ">="
* Update computeType and computeTypeParamOrArg to return new consts
* Extract splitGtEq/GtGt/GtGtEq from splitEndGroup
* Hide internal TypeInfo and TypeParamOrArgInfo consts

Change-Id: Ice550f5b15df1f3cad616a2a342644974f14d8ee
Reviewed-on: https://dart-review.googlesource.com/69261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-10 15:09:21 +00:00
danrubel fea8cb1473 Revise order of type variable declaration events
As of this CL, events for type variable declarations occur
in the following order:

* beginTypeVariables
* beginTypeVariable for each type variable in the declaration
* handleTypeVariablesDefined
* endTypeVariable for eah type variable in the declaration
* endTypeVariables

Revising the order of events facilitate removing the hack
in BodyBuilder.beginTypeVariables in a future CL.

This is another slice of https://dart-review.googlesource.com/c/sdk/+/57661
so that it can be landed in a more incremental fashion.

Change-Id: Ief0ad766c12f1ca9d53a8ec8d3c08b41166b2897
Reviewed-on: https://dart-review.googlesource.com/61940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-06-22 19:47:46 +00:00
danrubel e9bc3352e0 Replace and remove parseType
Change-Id: Id276165dbe6c7168d4156fd755f3f32c835d93af
Reviewed-on: https://dart-review.googlesource.com/61321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-06-21 22:01:05 +00:00
danrubel 8419090c8c Cleanup type variable event sequence
This is another step towards cleanup and improved recovery when parsing
type variables in fasta.

* call listener.handleIdentifier before beginTypeVariable

This is a slice of https://dart-review.googlesource.com/c/sdk/+/57661
so that it can be landed in a more incremental fashion.

Change-Id: I9cc483636f0b0f3168b92981695334c18bdfedfb
Reviewed-on: https://dart-review.googlesource.com/61320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-06-20 20:50:34 +00:00
Dan Rubel daee781179 Revise beginTypeVariable event in event sequence
This is the first CL in a series aimed at removing the need to reparse type variables in
https://github.com/dart-lang/sdk/blob/master/pkg/front_end/lib/src/fasta/kernel/body_builder.dart#L3669
and ultimately improving recovery by removing parseType.

* Move calls to listener.beginTypeVariable after parsing metadata and identifier
* Pass variable name via beginTypeVariable rather than via handleIdentifier
* Add additional check in test for issue 31846

Change-Id: I983b9d17675fc899c83df69fa1777059903e3f52
Reviewed-on: https://dart-review.googlesource.com/58300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-06-05 15:11:00 +00:00
Peter von der Ahé b3bae4262d Fix a batch of long lines
Change-Id: I9ae610f7e6e588ecec961af9ea72dcf6ee1751b7
Reviewed-on: https://dart-review.googlesource.com/57506
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-31 12:25:22 +00:00
Dan Rubel b7336ab443 Improve field type argument recovery
This CL improves recovery when parsing field type arguments
and adds more tests for parsing type parameters and type arguments.

Change-Id: Ib6ee4081f898d0421d90a66de84d686206a06a8f
Reviewed-on: https://dart-review.googlesource.com/56682
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-29 16:30:46 +00:00
danrubel b4699ae795 Improve type parameter and type argument recovery
This improves recovery when parsing type arguments in
* top level fields and functions
* class members

and when parsing type parameters in
* top level functions
* class declaration
* class methods

Change-Id: I7dbb520d6bb39c0d13b27698658dafe580f2b16c
Reviewed-on: https://dart-review.googlesource.com/56681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-26 02:25:53 +00:00
danrubel 544863fe68 Remove the no-op rewriter tests
Change-Id: I416ee350e1e7346493a3c4df3616f11d3b637d7c
Reviewed-on: https://dart-review.googlesource.com/56680
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-26 02:25:53 +00:00
Dan Rubel 137942aca5 Implement TypeParamOrArgInfo.parseVariables
This CL is the next step in replacing parseType and improving recovery.
It introduces a new parseVariables method for parsing type parameters
(aka type variables) method in addition to improving recovery in the
parseArguments method.

Change-Id: I4049528152a7c731771d7a8145e5f79729165d79
Reviewed-on: https://dart-review.googlesource.com/55301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-16 11:44:08 +00:00
Dan Rubel 64754764b1 Update computeType to call computeTypeParamOrArg
This is another step to replacing parseType with computeType
and improving recovery when parsing types and type arguments.

This adds a new computeTypeParamOrArg utility which returns
one of a couple constants for common situations or an instance
of ComplexTypeParamOrArg. The computeType function and
some places in ComplexTypeInfo class have been updated to use
this new method, but there are additional places that will be
tackled in subsequent methods.

Change-Id: I7012b65580e9dbc74b9424456262aa3c0367f48b
Reviewed-on: https://dart-review.googlesource.com/53641
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-04 13:38:07 +00:00
Dan Rubel 73768a5342 General TypeInfo and IdentifierContext cleanup
* Assert computeType and TypeInfo.skipType do not modify the token stream
* Rename TokenInfoTest to TypeInfoTest
* Move skipMetadata to util.dart
* Address comments in https://dart-review.googlesource.com/c/sdk/+/53300

Change-Id: Id2dbe54c5bc688db268e18b0a491367115f7b091
Reviewed-on: https://dart-review.googlesource.com/53640
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-03 16:38:24 +00:00
Dan Rubel 313b5bd191 Rename TypeInfo subclasses and constants
Rename the TypeInfo constants and related constants in preparation
for refactoring and improving type argument and type parameter parsing.

Change-Id: I5a741ee06f373800973942c233490fe83916e39c
Reviewed-on: https://dart-review.googlesource.com/52140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-20 16:07:39 +00:00
danrubel 10b441b16b Improve conditional import expression recovery
This improves recovery when parsing conditional import expressions
by repositioning the synthetic closing ')' that was inserted by the
scanner in a less than optimal location.

This approach relies on the beforeSynthetic field being set correctly.
While the scanner still sets the 'next' and 'beforeSynthetic' fields
directly for efficiency, most other functions which update an existing
token stream have been revised to call 'setNext()' rather than setting
the 'next' field directly. This ensures that the 'beforeSynthetic' field
will be correctly updated.

Change-Id: Id631fd600c64d1feaf00593acb74a7070e354f07
Reviewed-on: https://dart-review.googlesource.com/52120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-20 13:58:50 +00:00
Dan Rubel 499b6ba4cf Improve fasta parser computeType recovery
This CL improves recovery when a type is required to interpret
"Foo.", ".", and ".Foo" as malformed prefixed type references.
When a type is *not* required, each of the above are still interpreted
as no-type-reference.

Change-Id: Ia20caa8619821d24c5b16fd0015cee03987ee2a6
Reviewed-on: https://dart-review.googlesource.com/51900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-19 16:08:49 +00:00
Dan Rubel 8e812ddaa5 Pass modifiers in beginFormalParameters event
This CL updates the beginFormalParameters event to include
the covariant and const/final/var modifiers, and cleans up
a number of unused classes and methods including:

* the original implementation of ModifierContext/Recovery
* handleModifier and handleModifiers events

Change-Id: Ie89a202d17872fba85cd1a477091472a8d2d223b
Reviewed-on: https://dart-review.googlesource.com/51380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-17 20:27:37 +00:00
Dan Rubel e9616da13e Cleanup TypeInfo
This CL cleans up the TypeInfo library including:
* moving ComplexTypeInfo to type_info_impl.dart
* splitting up and enhancing the tests
* adding a new ensureTypeOrVoid method for use in a subsequent CL

Change-Id: I2d13f74152f8c4eb2e8b3ee504f108225cfa60eb
Reviewed-on: https://dart-review.googlesource.com/51080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-13 09:25:47 +00:00
Dan Rubel c502578096 Replace skipTypeReferenceOpt with computeType
... and also address comment in
https://dart-review.googlesource.com/c/sdk/+/49340

Change-Id: Ie9bcea39bd2b9c0199c92647b2a5ae0240276c1e
Reviewed-on: https://dart-review.googlesource.com/49561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-05 09:56:16 +00:00
Dan Rubel 6180f12ccf Update parsing as/is expressions to use computeType
This introduces a new TypeInfo.ensureType method which recovers
when a type is required but there is no type.

Change-Id: Ie9080864f814329bc7a7dcdf73440fd184e9e0f8
Reviewed-on: https://dart-review.googlesource.com/47944
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-03-23 17:58:59 +00:00
Dan Rubel 8630c69c9f Add typeInfo expression accessor
Change-Id: I1d97bb6b64a09f44182677d691b0c3c78c22ec6f
Reviewed-on: https://dart-review.googlesource.com/47060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-03-21 14:21:09 +00:00
Dan Rubel 0175f24b25 Assert errors during TypeInfo.parseType
... and Address comments in
https://dart-review.googlesource.com/c/sdk/+/46561

Change-Id: Ic3a183d83a4afea2e759e371306b6eb2b3c6ba6a
Reviewed-on: https://dart-review.googlesource.com/46600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-14 21:00:41 +00:00
Dan Rubel 3be356e96d Improve TypeInfo recovery when missing a comma
Change-Id: Iac7093e7ac71e20f15ece29a4cda75630b167253
Reviewed-on: https://dart-review.googlesource.com/46561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-03-14 18:13:48 +00:00
Dan Rubel 983e7b3662 Update TypeInfo to correctly parse "T<void>"
Change-Id: I2fe4d1c36c52a599d9d80809d88562657100dcdf
Reviewed-on: https://dart-review.googlesource.com/46480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-03-14 14:54:35 +00:00
danrubel f5ec1143ab Reorganize TypeInfo tests
Change-Id: I03306fcb2a91546931aef3056be36a43e983822a
Reviewed-on: https://dart-review.googlesource.com/46380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-03-13 23:54:10 +00:00
Dan Rubel ff9591d2d3 Extract computeType from parseType for better recovery
This CL extracts the core logic out of parseType into a new computeType
function. This enables the TypeContinuation logic in parseType to be
moved into the callers of parseType so that recovery can be improved.

Change-Id: Ibded6f5eacfeaccdc6c56e234b305596d9582a92
Reviewed-on: https://dart-review.googlesource.com/45760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-03-13 14:49:59 +00:00
Brian Wilkerson fcfdb8a4d5 Replace TokenStreamRewriter.insertToken with insertTokenAfter
Change-Id: I110099eaf0db7f4b09a8225ffaf674e132ce3d43
Reviewed-on: https://dart-review.googlesource.com/28260
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-11 21:24:53 +00:00