Commit Graph

36 Commits

Author SHA1 Message Date
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
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
Jens Johansen 5c2b86897c [parser] late is a built-in identifier
Fixes #38803

Change-Id: I2fe7817aa0311c2370222a3205f1a1e02dc9aba4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-11 06:19:13 +00:00
Kallen Tu b699852e6d Add 'out'/'inout' keywords for variance.
Under the `variance` flag, `out` and `inout` will be treated as keywords.

Change-Id: I73ba6871a9f0d410a7b3818833a1f50a5f75fba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117203
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-09-18 18:35:59 +00:00
danrubel 6bd64ff8b2 cleanup StringScanner references
Change-Id: Ic75305c7a76860c5b96032d4f8c8fff695006f22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-14 13:39:47 +00:00
danrubel 7983fac33b add "extension" built-in keyword for extension methods
Change-Id: I6529fff31f681fd24c22f8c7579d2a35097f4d07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-17 22:24:15 +00:00
Dan Rubel a20e7eee15 update scanner config based on language comment
... and add ScannerConfiguration.nonNullable const

Change-Id: I6917c535e40e94cb591f2c4f5582dc0127be17f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100884
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-30 21:28:02 +00:00
Dan Rubel fd48001ace Put NNBD modifiers behind a flag
Fix https://github.com/dart-lang/sdk/issues/36691

Change-Id: I48aa72eb6a4aa63d072089baaf99d249763095fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99963
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-22 15:31:09 +00:00
danrubel a2e06eafff allow built-in keywords as identifier in for-in loop
Fix https://github.com/dart-lang/sdk/issues/36678

Change-Id: I2af3a21e96c5654b12c199fc71d87f088e9d739d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99904
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-19 19:07:11 +00:00
danrubel f3703c1bce change "late" from built-in to keyword
Change-Id: I851bc1a6db305c6fa7f5be001af1632d6d69aa2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99739
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-18 16:42:28 +00:00
Dan Rubel dd3530450d make "late" and "required" builtin keywords
Change-Id: Ia352ec979bc04edcb1e9ee9733a3f86d8e5ce1a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99644
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-17 18:51:01 +00:00
Dan Rubel ebdefa3f5f add new "late" and "required" modifiers
Change-Id: Iec0acac1bb4280f31bd32297543eceb54f87f1ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-17 15:01:36 +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
Dan Rubel aa6945d5e9 First cut basic mixin declaration parsing support
... with parser recovery added in subsequent CLs.

Change-Id: I7a73e8e2a4dee961920fe9854bcd108bb1041b20
Reviewed-on: https://dart-review.googlesource.com/70882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-24 21:58:55 +00:00
danrubel 998f1e5106 Remove old scanner from token test
Change-Id: I61e80f5fa7f9bd6f06401e668bdeb134e9ac22f1
Reviewed-on: https://dart-review.googlesource.com/65921
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-07-20 17:26:31 +00:00
Lasse R.H. Nielsen a4494a7fb2 Make mixin and interface built-in identifiers.
Fixes #33113

Bug: http://dartbug.com/33113
Change-Id: I4b0b7c9d82ae9df6a7e9f71168ca981c62c7a2f1
Reviewed-on: https://dart-review.googlesource.com/55222
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-18 09:57:17 +00:00
danrubel 1582021556 Allow built-in keywords as top level function identifiers
Change-Id: I4287e8279d2ebe6f4460ce48409b7bd9ead16b96
Reviewed-on: https://dart-review.googlesource.com/13627
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 23:48:05 +00:00
Dan Rubel 9c1d97bb9c update parser to use token.isModifier
Change-Id: Iee07cbde6c45b621bb13d1774c1d9f4bd97268ea
Reviewed-on: https://dart-review.googlesource.com/6840
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-09-19 20:27:03 +00:00
Brian Wilkerson 7cf0a22f43 Make covariant be a modifier in front_end
Change-Id: I66f8823207f6231b8318b8ac0530f1c51f9b702d
Reviewed-on: https://dart-review.googlesource.com/3282
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-09-05 16:25:06 +00:00
Dan Rubel 813d4eddf8 gracefully recover from extraneous top level modifiers
When the user includes extraneous modifiers preceeding top level
directives and declarations, the fasta parser now report an error
and skips the modifier.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/3007943002 .
2017-09-01 18:55:02 -04:00
Dan Rubel 54d6e3a1c5 cleanup fasta token classes
* replace fasta.SymbolToken --> analyzer.Token
* replace fasta.BeginGroupToken --> analyzer.BeginToken
* replace fasta.SymbolToken.eof --> analyzer.Token.eof

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2899043006 .
2017-05-25 07:26:50 -04:00
danrubel 498a39ed61 delete obsolete scanner roundtrip test
Review-Url: https://codereview.chromium.org/2900303003 .
2017-05-24 21:07:25 -04:00
Dan Rubel 278c7bfbeb merge fasta.Token into analyzer.Token
This eliminates much of the duplication between the two token hierarchies
by merging much of the fasta.Token hierarchy into the analyzer.Token.

* merge token hierarchies
* cleanup fasta.Token.copy()
* set preceedingComments field via constructor
* replace isBuiltInIdentifier --> type.isBuiltIn
* change all fasta.Token references to analyzer.Token
* move fasta.Token.value() implementation into analyzer.SimpleToken

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2890523002 .
2017-05-16 11:50:14 -04:00
Dan Rubel d566906167 cleanup unused incremental resolution
* remove unused analyzer incremental resolution
* remove unused Token.applyDelta method

Patch Set 1 is the original CL that was landed and reverted
https://codereview.chromium.org/2876993005

Patsh Set 2 contains additional fixes and test changes

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884853002 .
2017-05-16 07:53:17 -04:00
Dan Rubel d644be82ab Revert "cleanup unused incremental resolution"
This reverts commit 77b383e6b8.

Review-Url: https://codereview.chromium.org/2887443002 .
2017-05-15 11:01:57 -04:00
Dan Rubel 77b383e6b8 cleanup unused incremental resolution
* remove unused analyzer incremental resolution
* remove unused Token.applyDelta method

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2876993005 .
2017-05-15 09:09:25 -04:00
Dan Rubel e0e892008a remove TokenType.KEYWORD
Breaking change to be landed after all existing callsites
have been converted to use the new API.

This is part 2 of https://codereview.chromium.org/2842643004/

* make Keyword extend TokenType
* make TokenType.AS be the same object as Keyword.AS
* make TokenType.IS be the same object as Keyword.IS
* remove TokenType.KEYWORD
* remove unnecessary Keyword.info method

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2848493003 .
2017-05-08 11:20:21 -04:00
Dan Rubel 46b0c1da56 merge fasta.Keyword into analyzer.Keyword
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2797133008 .
2017-04-06 16:52:01 -04:00
Dan Rubel 4b8a2eb03b enhance analyzer to parse uppercase and built-in/pseudo keywords
Retrying https://codereview.chromium.org/2803563003

* update analyzer.Keyword list to include all of the fasta keywords

* enhance the analyzer scanner keyword table to handle uppercase
  keywords such as "Function"

* update analyzer's parser to process the new KeywordTokens

* fix analyzer error verification

* update translation of fasta <--> analyzer tokens

* update tests and cleanup analyzer warnings

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2799133003 .
2017-04-06 15:24:53 -04:00
danrubel e7f700ae66 Revert "enhance analyzer to parse uppercase and built-in/pseudo keywords"
This reverts commit 0c9e871b0f.

Review-Url: https://codereview.chromium.org/2797353002 .
2017-04-05 17:27:41 -04:00
Dan Rubel 0c9e871b0f enhance analyzer to parse uppercase and built-in/pseudo keywords
* update analyzer.Keyword list to include all of the fasta keywords

* enhance the analyzer scanner keyword table to handle uppercase
  keywords such as "Function"

* update analyzer's parser to process the new KeywordTokens

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2803563003 .
2017-04-05 16:37:30 -04:00
Dan Rubel a370462274 move fasta.Keyword methods to analyzer.Keyword
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2800583002 .
2017-04-05 13:51:53 -04:00
Dan Rubel 05300ea2df change "deferred" keyword isPseudo --> isBuiltIn
Fix https://github.com/dart-lang/sdk/issues/29069

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

Review-Url: https://codereview.chromium.org/2769253002 .
2017-03-25 21:20:11 -04:00
Dan Rubel 80c8479587 fasta.CommentToken implement analyzer.CommentToken
* update the fasta scanner to generate comment and dartdoc tokens

* replace fasta.preceedingComments field
  with preceedingCommentTokens field and preceedingComments getter/setter

* update token translator

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2763833002 .
2017-03-21 11:40:47 -04:00
danrubel 08402f5789 update fasta scanner to generate two types of comments
* replace fasta.COMMENT_INFO
  with fasta.SINGLE_LINE_COMMENT_INFO and fasta.MULTI_LINE_COMMENT_INFO
  so that it matches analyzer scanner output

* added test for fasta.isUserDefinableOperator

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

Review-Url: https://codereview.chromium.org/2757153002 .
2017-03-20 15:12:28 -04:00
danrubel e93ad0d4fc fasta.Token implement analyzer.Token
* fasta.Token implements analyzer.Token
* cleanup and improve PrecedenceInfo tests

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

Review-Url: https://codereview.chromium.org/2757113002 .
2017-03-20 14:06:06 -04:00