Commit Graph

124 Commits

Author SHA1 Message Date
Sigmund Cherem 912005267d [web] rename suite dart2js -> web.
Change-Id: I46be49b2effec3e38a3dc44cd45cfe736f77fa78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-04 23:11:32 +00:00
Clement Skau 2236883ff2 [SDK] Removes non-exiting tests from .status
TEST=Tested all configurations.

Change-Id: Iec00d7e6ea56221ffebcf044de22647907f598f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182500
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-02-04 06:46:13 +00:00
Johnni Winther 34fb48bb8a [kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
Migrates libraries dependent only on already migrated libraries.

Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-01-18 15:40:21 +00:00
Jens Johansen f7052cfbbc [parser] Better handling of eof when parsing 'Stream<List<>>'
This CL avoids the infinite loop created by allowing the parser
to parse it as a complex type (despite no actual name after it) and
adds a few asserts in an attempt to catch rewriting on eof (setting a
token after eof).

Fixes #42229
Fixes #44477

Change-Id: Ie2da0957894067a3d4748cb6384bc9d6cf32c215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150521
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-11 09:55:06 +00:00
Sam Rawlins 090e234172 Remove unused dart:async imports
As of Dart 2.1, Future/Stream have been exported from dart:core.

Change-Id: Ia4d70d1ccb55ac117bafe630a24b4ee2f60ff993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170126
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-03 18:49:54 +00:00
Jens Johansen f4d3f8e0a2 [parser] Delete unused TokenStreamGhostWriter; test used UndoableTokenStreamRewriter
Change-Id: I7f4f053273f70d282b2ced7338715ca314055065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162190
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-09-11 06:46:11 +00:00
Jens Johansen b0acaea1e5 [parser] Recover written out binary operators
* Add mechanisms to try out a recovery and only perform it if is
  successful.
* Recover written out binary operators, e.g. "a xor b", "a or b" etc.
  This fixes #26810 and is also how these operators are written in e.g.
  Kotlin. This might be somewhat controversial though.
* Adds a mechanism to _replace_ a token by another token.
  This might be controversial.
  It is done because just inserting the operator causes the same rewrite
  to be attempted on the same token stream several times (at least with
  the way the token stream is parsed via the CFE) in turn causing it to
  be recovered *sometimes*. This is now avoided by actually replacing
  the token.

Change-Id: Icfa806045575d2aa2e5f35126708651b275bcf84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162003
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-09-10 06:23:33 +00:00
Jens Johansen 3a1f732c0f [parser] Make begin/end events always come in pairs
This CL:
* Changes the events so beginX and endX events always comes in pairs
  (though technically not right as some specific events can be beginX
  endY --- but in those cases it is at least documented and used in code
  that actually tests it).
  -> This entails adding some events and converting something from
    "beginX" to "handleX" instead.
* Adds a utility that can generate an AST of sorts directly from the
  parser via a listener using the begin/end matching (and knowing of the
  specific ones that doesn't match directly).
* Adds a test that checks that - at least for all tested (50,000+) files
  - the AST actually generate "correctly", i.e. matches up begin/ends
  and ends up with a single top entry "CompilationUnit".
* Adds a different visualization to the parser listener events by
  displaying the "AST directly from the parser" in a UI that can be
  navigated. The visualization may not be the best, but it's certainly
  a stepping stone.

Change-Id: I9b27f7bbf3be442adc92f357c7b3c46da6f84cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159664
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-01 09:30:43 +00:00
Jens Johansen 8bca93872a [parser] Better error message for annotations on type arguments
This CL changes the message given in the situation identified in
https://github.com/dart-lang/sdk/issues/22314

Fixes https://github.com/dart-lang/sdk/issues/22314

Change-Id: Ibd47dd419d52673ae0d9e32039e0a635c1e09543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158388
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-17 07:43:52 +00:00
Johnni Winther a021b99fc3 [cfe] Fix scope setup for generic function types
Closes #36870
Closes #41951
Closes #42364

Change-Id: Id323bfdc26c688bfeb756ef8c1e0530283b44e34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156028
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-29 09:04:24 +00:00
Johnni Winther 9ab7a5edef [cfe] Use variable name in error message for missing initializer
Closes #42610

Change-Id: I70a5ac9302bd6545cd5e73f2dab61a29bc6a3000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153462
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-08 12:45:15 +00:00
Joshua Litt f9f1ca6171 [dart2js] Create tests/dart2js for nnbd.
Change-Id: Ib8721cf976803d8d1b9d723b7e691e344c768b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-09 16:53:15 +00:00
Joshua Litt 451694e855 [dart2js] Move dart2js_native to dart2js/native.
Change-Id: I2f879fe18376b8c1b82fc201d488425dc154d2b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149341
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-04 18:11:49 +00:00
Joshua Litt 05ca544f15 [dart2js] Move tests/compiler/dart2js_extra to tests/dart2js_2.
Change-Id: Iaa0ca2b4f2d1b15f79ddca37834d3ed2497bc068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149242
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-03 15:15:30 +00:00
Joshua Litt 20faaa5d94 [dart2js] Move dart2js unit tests to pkg/compiler/test.
Change-Id: Ib18f554c1076f27a3f7c0df5a36410da41a1f467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148784
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 18:51:11 +00:00
Paul Berry 275b922ee8 Revert recent parser fixes
Commit 1f9b5c1996 causes tests to fail
in angular when rolled into internal sources; the other two commits
need to be reverted as well to avoid merge conflicts.

This reverts commit 1f9b5c1996.
This reverts commit c40b24da48.
This reverts commit 96df1f9e6c.

Change-Id: Ic4e55181ef60e825ce4409a9a9528ecbf19c39c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147822
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-12 22:02:09 +00:00
Jens Johansen 96df1f9e6c [parser] Add ErrorToken for ignored (unmatched) end parenthesis, brackets etc
Change-Id: Idb57295700988d71321743af9782134b02562311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-11 14:46:47 +00:00
Jens Johansen 5e3972ffd4 [CFE] Sort status files
Change-Id: Ia7e65057fc15ee36e6e9547906bcc9298fc3df93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142141
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-04-03 06:24:26 +00:00
Jens Johansen f828f00b59 [parser] Error recovery of type parameters on void
Fixes #39958.

Change-Id: I851bef762776f4b68f0fcb645d634019b8b32e81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137925
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-04 14:02:35 +00:00
Jens Johansen 3660b9ecc7 [parser] New syntax for null aware index (2nd try)
This reverts commit bc4893a3b3.

The previous attempt failed because when we check if something is a
conditional expression we used a rewriter that didn't actually rewrite.
This further down the line (still checking if we can parse the expression)
results in errors occurring (that wouldn't have occurred if the rewrite
had happened) and the conclusion was thus that it wasn't a conditional
expression and we parsed it as a null-aware index operator (which gave
errors because it wasn't).

This 2nd try solves it by having a rewriter that actually rewrites,
but then allows to undo the rewrites after we're done parsing.

Change-Id: Ide3c0d6a870d4dc18b6d9475b0227d93c733dc7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136624
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-26 13:31:52 +00:00
Robert Nystrom db64f9ecb2 Delete standalone_2/io/process_exit_negative_test.dart.
I am trying to migrate all of the negative tests to something more
precise. As far as I can tell, this test stopped being useful with Dart
2.0. Now that all compilation errors are reported eagerly, the file
simply doesn't run at all. It's now just another test of an unresolved
identifier.

(This is a good example of *why* I want to get rid of negative tests.
This test silently went from a desired runtime failure to a compile-time
failure.)

Change-Id: Iec3cdd32a15612c0760119e92d618e3a5ba1f5ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125555
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-11-19 18:23:30 +00:00
Johnni Winther 00c2962db8 [cfe+analyzer] Move messages, scanner and parser to package:_fe_analyzer_shared
Change-Id: I4fa87aee65f30a9868a6cf8f0342591869ece7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 09:37:57 +00:00
Johnni Winther d76ffbc149 [cfe] Handle assigned variables in for and for-in
Change-Id: I06deda7f017dcd40e5c6987c61261cf3be2be0ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123410
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-10-31 11:36:43 +00:00
Kallen Tu 327bc451f8 Added variance support in listeners to ast.
Pass variance data to field in TypeParameter through the listeners.
ast_to_text will print variances for classes and mixins if specified.

Avoids serialization/deserialization (impl in future CL).

Change-Id: I298537604823710f0d30001f4cb5f1e81530959f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118464
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-09-26 18:11:10 +00:00
Johnni Winther 7dbf8eed3b [cfe] Support sharding in pkg/testing tests
Splits strong_test into 4 shards. This test took 4+ minutes locally with
the fast_strong_test and analyze_test ticking in at ~1:45. This change
makes local testing of frontend unittests take 2 instead of 4 minutes in
total.

Change-Id: Id6015de86d547b209a699b1e5196b3edad1e6977
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114501
Reviewed-by: Jens Johansen <jensj@google.com>
2019-08-27 09:56:53 +00:00
Jens Johansen bd681ea660 [CFE] Move testing out of lib/src/fasta
Change-Id: I477892fa9268ab3715152c0253dd65a1c1541c1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114072
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-23 06:20:03 +00:00
Jens Johansen cae08c6813 [CFE] Apply lines_longer_than_80_chars lint
Change-Id: I35b62b34d3ccc7098c21a680a80612c0bb927123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113030
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-15 10:01:20 +00:00
Jens Johansen 5601eabda6 [CFE] Spell check messages and dart code
This CL adds a simple spell-checker, adds a spell-checking-phase to
messages_test to spell-check our messages, adds a new test that
spell-check our dart-code and fixes a lot of spelling mistakes / typos.

Change-Id: I8943a5bd67970e9a8a775251ae0aa97799eab097
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112346
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-09 08:47:00 +00:00
Vyacheslav Egorov a86db84e0a [fasta] Preserve information about const constructors in outline.
- for classes with const constructors parse field initializers;
- for const constructions parse initializer lists and default parameter
values;

Fixes issue https://github.com/dart-lang/sdk/issues/37357
Fixes issue https://github.com/dart-lang/sdk/issues/36635

Change-Id: Iff0e47f8bd2925cee9f42a2b309de4de84e99cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108279
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-09 14:02:01 +00:00
Vijay Menon 3b5a187726 [dartdevc] move ddc internal libraries under sdk
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.

This should enable https://github.com/dart-lang/build/issues/2262

Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-04 13:47:29 +00:00
danrubel c33f1a079e revise scanner api so that error tokens are always prepended
This CL revises the scanner API so that tokens are always prepended
to the beginning of the token stream. This allows the parser handling
of error tokens to be simplified. Any clients using the scanner directly
rather than through the scanner API should call scannerRecovery
if the scanner has detected errors in the content.

Change-Id: I32510da10205bd964f80898a238489d1508733e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-17 20:59:51 +00:00
danrubel 7ec4621108 cleanup scanner configuration flags
* rename enableGtGtGt to enableTripleShift
* remove unused enableGtGtGtEq field

Change-Id: I0fa881c45619067ec3a292acbff984db555aa43e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-04 17:14:46 +00:00
Dan Rubel 4d7217016e encapsulate scanner configuration in ScannerConfiguration
... and update TypeInfoTest to use ScannerConfiguration

Change-Id: I637d6fbeecd0b6d16c37e57cfd8ba9fc1fba494a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100791
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-30 14:00:28 +00:00
Dan Rubel 08832508ec Forward "late" modifier to parser listeners
... and update parser tests to use preNonNullable feature set
to address comments in https://dart-review.googlesource.com/c/sdk/+/99963

Change-Id: I3a3293d65805807b7b95e887f829f3f0080ae3b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99964
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-22 17:20:10 +00:00
Dan Rubel ca28e2c8ce forward "required" modifier to parser listeners
... and have each report an error by default

Change-Id: If818a7bb207becbed95a97890632a1803917d285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-17 21:19:51 +00:00
Dmitry Stefantsov 4a1b153fe1 [cfe] Enable type promotion in if-elements of literal collections
Closes #36396.

Bug: http://dartbug.com/36396
Change-Id: I223267cdee1aca38d69354e4f97df7dcc76e9553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98461
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-02 13:33:19 +00:00
danrubel 466b6884dc add scanner/parser support for >>>=
Change-Id: I8bbf19e70f35aba600cb768fc3c7537f2aa604e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97602
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-22 23:38:51 +00:00
danrubel 266d823f5c remove unused scanner error list
Change-Id: I3dd5d66dcf05ae2bf9f2087724801cae4f3b6036
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97542
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-21 22:33:02 +00:00
danrubel b2cb604b9d improve literal list/map/set control flow recovery
* new ExpectedElseOrComma parser error code
* update recovery tests to enable control flow recovery
* rework test to call parser.parseLiteralListSuffix rather than parser.parseLiteralListSuffix

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

Change-Id: I5bdee19eb3828de8fbdc514a3820afaa1309df99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-08 17:31:33 +00:00
Dan Rubel 272f58e543 Revise parser to generate handleLiteralSetOrMap
... and no longer generate handleLiteralSet or handleLiteralMap.
In addition, a new hasSetEntry parameter has been added to the
handleLiteralSetOrMap event generated by the parser to support
existing behavior. Once all listeners have implemented
unified collections and that feature is enabled by default,
the hasSetEntry parameter can be removed.

This is the third of several CLs updating the parser and its listeners
to conform to the unified collection spec:
https://github.com/dart-lang/language/pull/200

Change-Id: Ia305eab1f720658f357ac4102b0b0c8128d16997
Reviewed-on: https://dart-review.googlesource.com/c/93963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-22 19:58:38 +00:00
Dan Rubel 09e6a689c2 parse nested control flow collection entries
Change-Id: Id50c0a53a51f076dd75dd5bc13a694663449bc83
Reviewed-on: https://dart-review.googlesource.com/c/91400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-29 17:53:58 +00:00
Dan Rubel 213cfdc85e Update AstBuilder to generate new for statement structure
... if control flow or spread collection entries are enabled.

Change-Id: I8718c1f7a649b7a2a7c9e376a6bf67c1df0542cf
Reviewed-on: https://dart-review.googlesource.com/c/91320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-29 17:53:58 +00:00
Dan Rubel 93a56336a3 Parse simple for control flow collection entires
... and address comments in:
https://dart-review.googlesource.com/c/sdk/+/91144
https://dart-review.googlesource.com/c/sdk/+/90901

Change-Id: I7a9288bf28e069832193bd8a196a11f9a407b20d
Reviewed-on: https://dart-review.googlesource.com/c/91300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-29 17:53:58 +00:00
danrubel 56123f08b0 Update parser to support simple if/else control flow in literal lists, sets, and maps
Change-Id: I740beea833ed1ad76582ad5232549bd204981808
Reviewed-on: https://dart-review.googlesource.com/c/90901
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-24 22:22:50 +00:00
danrubel 5543fce9a3 add limited support for parsing if control flow entries in lists, sets, and maps
This updates the parser to handle two if control flow entries
* `if` condition entry
* `if` condition spread-collection

... and also addresses comments in
https://dart-review.googlesource.com/c/sdk/+/90500

Change-Id: Ibabec8f0f4da918ef4cfe429405dae82ba74c129
Reviewed-on: https://dart-review.googlesource.com/c/90620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-23 17:57:05 +00:00
Sam Rawlins 3154bb0d37 Stop using external deprecated members in front_end
Change-Id: I3fa03de568f72bfc3adb46efcfa2b61b781c706b
Reviewed-on: https://dart-review.googlesource.com/c/89020
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-15 18:55:10 +00:00
danrubel 2cb346bd0c Add support for parsing complex nullable types
Change-Id: I38a59f96e299387b7266e46082d876105eb60f1e
Reviewed-on: https://dart-review.googlesource.com/c/88640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-08 15:52:54 +00:00
danrubel 26d5345fb1 Fix TypeInfo.couldBeExpression in recovery situations
Change-Id: Ia9f1735b8ad28dbfcde1f54ac70628e85b65c1d3
Reviewed-on: https://dart-review.googlesource.com/c/88480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-04 21:08:35 +00:00
danrubel f0377b2f92 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.

Due to current parser limitations, it also only supports
nullable types in a limited number of statements such as

T? t;
if (x is String?) {}

In addition, address comments in
* https://dart-review.googlesource.com/c/sdk/+/87880
* https://dart-review.googlesource.com/c/sdk/+/87881

Change-Id: Ife4afadc0b72906fc0c4e9b1977ad838041c2a84
Reviewed-on: https://dart-review.googlesource.com/c/87920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-21 12:36:07 +00:00
danrubel c52ff42c55 Add TokenStreamGhostWriter for parser lookahead
This adds a new TokenStreamRewriter which does not modify the
existing token stream but instead sequences tokens such that the
new tokens lead into the existing token stream.
This is useful when using the parseExpression method
to lookahead and find the next token after the expression.

Change-Id: Id51e015f4381af65220530d07042e306b939baa3
Reviewed-on: https://dart-review.googlesource.com/c/87622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-18 22:01:48 +00:00