Commit Graph

60 Commits

Author SHA1 Message Date
Paul Berry 63001295c0 optionally report scanner errors before parsing
The fasta parser handles error tokens produced by the scanner
but the old parser expect error tokens to have been already
translated into error messages. This updates the analyzer scanner
to optionally translate scanner errors.

Change-Id: I62383965285511c93e8fbf6a4cada97e9e4e3c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102143
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-10 17:49:57 +00:00
danrubel b4e2c0246c update parser to handle leading error tokens
This is the first of several CLs that move error tokens to the head
of the token stream so that parser handling of error tokens
can be simplified and less error prone.

In this particular CL:
- update parser to handle error tokens at the head of the token stream
- remove several places that analyzer was preprocessing error tokens
   now that the parser handles them

Change-Id: Iddf60ab2879567a345a692b64043bd42f1871947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-09 18:36:31 +00:00
danrubel a83fbc5edb remove unused enable lazyAssignmentOperators flag
Change-Id: I4112fe4ad5a08916d124216753a995d607a9892d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101485
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-07 13:06:39 +00:00
Paul Berry cee1e41fe8 Plumb new FeatureSet class into Scanner.
And change clients of the scanner (within the SDK) to use it.

Long term, it would be better to store the FeatureSet object directly
in the Scanner and remove the existing flags `enableGtGt` and
`enableNonNullable`.  However there are analyzer clients that
currently use these flags.  So for now, we simply plumb in the
FeatureSet as a new way of setting AstBuilder flags.  Once we've
updated clients to use FeatureSet, we'll publish a breaking version of
the analyzer that removes the old flag API.

Change-Id: I9e662f4ed45668d9acd4f56e42d7d8dae6180d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99975
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-23 16:13:43 +00:00
Brian Wilkerson 5f0de26d48 Clean up the remaining copyright notices
Change-Id: If099be4f71ba551df0dc3d69815ae6a9f55d1eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-24 20:11:28 +00:00
Dan Rubel 8c7e83aed2 Remove generic method comment support
Change-Id: I1149ff9c61748fe8d3a51c95e40c02ec5115b0e7
Reviewed-on: https://dart-review.googlesource.com/72122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-30 17:52:40 +00:00
danrubel 166e3e12b3 Remove Scanner.useFasta
This removes some of the code that tests the unused pre-fasta Scanner code.

Change-Id: I2d20d286e71516d6c2430a8b8e06158b53ea1a89
Reviewed-on: https://dart-review.googlesource.com/64420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-07-11 14:25:44 +00:00
Brian Wilkerson c214c43758 Make LineInfo a public class
Change-Id: I1bc7f5302797374609752ea5293b96c30719b41f
Reviewed-on: https://dart-review.googlesource.com/51101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-13 16:23:47 +00:00
Dan Rubel 02ce510601 translate missing ">" fasta error code to analyzer error
Fix #30320

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2996673002 .
2017-08-11 15:29:49 -04:00
Dan Rubel 56402976cd more fixes for fasta analyzer integration
* fix scanner adapter setSourceStart
* fix fasta token copy() methods
* replace "is TokenWithComment" with "?.preceedingComments != null"
* update scanner test

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2928773003 .
2017-06-08 18:02:09 -04:00
danrubel 683e94aedb fix scanner test expectations
Review-Url: https://codereview.chromium.org/2911243003 .
2017-05-30 17:56:17 -04:00
danrubel 427c06c2fe fix fasta scanner adapter lineStarts
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2913043002 .
2017-05-30 16:54:05 -04:00
Dan Rubel 8928329339 improve fasta interpolation recovery
* improve fasta interpolation recovery by adding closing brace
    for unterminated string
* update analyzer scanner test because fasta does not support
    does not support \r line endings

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2910583002 .
2017-05-26 08:43:48 -04:00
Paul Berry 1c2268b13e Move scanner tests into the front_end package.
This required moving the following classes into front_end as well:
- CharSequenceReader
- SubSequenceReader
- JenkinsSmiHash

A small amount of the functionality of GatheringErrorListener and
AnalysisError had to be replicated, to avoid a dependency on the
analyzer package.  In a future CL I will either refactor this code to
make it available to the rest of the front end, or, if
GatheringErrorListener and AnalysisError wind up getting moved into
the front end, I will un-do the replication.

I also took the liberty of addition functionality to JenkinsSmiHash to
make it easier to use.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2508483002 .
2016-11-15 14:53:49 -08:00
Konstantin Shcheglov 5455fd0118 Remove 'initializeTestEnvironment' from 'analyzer'.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2399913002 .
2016-10-06 10:18:54 -07:00
Konstantin Shcheglov 175dad4f15 Switch 'analyzer' to 'package:test' and test_reflective_loader ^0.1.0.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2391423003 .
2016-10-06 08:46:35 -07:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Konstantin Shcheglov cc6beaf56d Pull in test_reflective_loader 0.0.4 and switch analyzer to it.
There are following changes:

1. DEPS to pull in test_reflective_loader 0.0.4
2. Rename runReflectiveTests() to defineReflectiveTests().
3. Remove analyzer's pkg/analyzer/test/reflective_tests.dart
4. Replace reflective_tests.dart imports with package:test_reflective_loader/test_reflective_loader.dart imports.
5. Sort/format and organize imports in the files with imports changes.
6. Fix for a couple of bugs in analysis_server exposed by the new loader.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2298913003 .
2016-08-31 13:46:39 -07:00
Brian Wilkerson 4dcb9b6196 Initial implementation for lazy compound assignment operators
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2199323002 .
2016-08-02 09:16:17 -07:00
Brian Wilkerson 71e7ed86c0 Move scanner out of generated and clean up imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1693083004 .
2016-02-14 07:48:44 -08:00
Brian Wilkerson f0d249e269 Clean up package imports and library names
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1513643009 .
2015-12-10 08:11:56 -08:00
John Messerly 3cb4cdec03 initial generic method comment parsing
R=brianwilkerson@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/1434863003 .
2015-11-11 16:27:27 -08:00
Brian Wilkerson 908708d655 More fixes for failures on the Windows bot
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1266923004 .
2015-08-05 08:13:28 -07:00
Konstantin Shcheglov 8eb0de07f3 Issue 23919. Fix for line starts in multiline comments.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/23919

Review URL: https://codereview.chromium.org//1271553002 .
2015-07-31 08:33:38 -07:00
Paul Berry 4b83219847 Switch on null-aware operators by default in analyzer.
Patches to update analyzer_cli and analysis_server will follow once a
new version of analyzer has been published.

BUG=dartbug.com/23793
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1239513005 .
2015-07-13 15:56:21 -07:00
brianwilkerson@google.com 81e474c43e Clean up many generated constructors
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1131423002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45676 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-09 19:06:12 +00:00
paulberry@google.com 6fe7a1d39b Scanner/parser support for DEP 9 (null-aware operators).
This adds scanner and parser support for the operators '?.', '??', and
'??='.

Support is not yet enabled--it is only turned on during the unit tests
for the new tokens and AST's.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1043583002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44770 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-28 02:25:32 +00:00
brianwilkerson@google.com 2fe598c6ea Fix line info for multi-line strings (issue 22794)
R=pquitslund@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1000913004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44481 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-13 21:54:16 +00:00
brianwilkerson@google.com 98b7382071 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//975453004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44149 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 21:34:46 +00:00
scheglov@google.com a38a503d86 Replace @ReflectiveTestCase() with @reflectiveTest.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//849863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42821 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:11:24 +00:00
paulberry@google.com 280657737f Annotate analyzer tests with @ReflectiveTestCase().
Fixes analyzer tests when run under dart2js.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//780763004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42181 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 21:00:51 +00:00
brianwilkerson@google.com e6686b2993 Move incremental scanner to separate file
R=scheglov@google.com

Review URL: https://codereview.chromium.org//746503002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41856 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 17:54:41 +00:00
brianwilkerson@google.com e65d299873 Code clean-up, add utility class for incremental scanning, add tests
R=scheglov@google.com

Review URL: https://codereview.chromium.org//742013003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41855 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 17:03:27 +00:00
scheglov@google.com b8da9bc651 Format and sort analyzer and analysis_server packages.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//725143004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41792 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 22:23:53 +00:00
brianwilkerson@google.com 0a20e03aa0 Add tests of incremental scanner
R=scheglov@google.com

Review URL: https://codereview.chromium.org//675173004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41374 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 21:51:42 +00:00
scheglov@google.com 63523cf050 Inline JUnitTestCase 'assert' methods.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//685573002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41347 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 00:00:13 +00:00
scheglov@google.com 71a54f980b Replace ${name} with $name where possible.
...i.e. when the next character is not a part of an identifier.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//681003002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41333 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 19:43:44 +00:00
scheglov@google.com 78c7e8fc06 Convert most of the EngineTestCase.createSource invocations into multi-line String literals.
There are sill invocations in Angular tests, but these call it with List<String>,
I will clean them up in the following CL.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//682553002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41308 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-26 22:03:21 +00:00
brianwilkerson@google.com 66f7c97acf Remove JavaStringBuilder
R=scheglov@google.com

Review URL: https://codereview.chromium.org//680863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41305 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-26 21:49:04 +00:00
scheglov@google.com ebf761a5af Convert all the generated tests to reflective.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//637003002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40974 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 19:48:40 +00:00
scheglov@google.com d682c178b4 Write end-of-block comments.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//624403002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40912 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-05 17:53:52 +00:00
scheglov@google.com 46b9b138d6 Move Tokenfactory, AstFactory and ElementFactory from tests to the testing/ Folder.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//351283003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37748 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-26 17:30:25 +00:00
scheglov@google.com d06a1cff08 New analyzer snapshot.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//322603002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37096 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-06 19:48:47 +00:00
scheglov@google.com 496aa45ed1 New analyzer snapshot. Sorted unit members.
New Character utilities.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//259773005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35468 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-26 22:37:24 +00:00
paulberry@google.com 6c000ea2cb New analyzer snapshot, based on r35422.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//257773008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35426 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 15:18:19 +00:00
scheglov@google.com e5652e0e90 New analyzer snapshot with MapIterator.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//229653004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34891 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-09 20:18:01 +00:00
scheglov@google.com 6da7a82a20 Fix for translation of \!= to \!identical(), but use == and \!= for Enum.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//221483002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34636 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 03:09:22 +00:00
scheglov@google.com 1145c19860 Rollback pkg/analyzer that breaks code_transformers
R=blois@google.com, brianwilkerson@google.com, sigmund@google.com
BUG=

Review URL: https://codereview.chromium.org//214593008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34479 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-27 20:29:08 +00:00
scheglov@google.com 240b4138ce Translate Java enums to Dart constants.
1. Restore "this.field" field formal initializers.

2. Tweaks for several Java places - mostly to the constructors; but also duplicate HintCode messages (in Dart we cannot get values of constant values final fields).

3. Translate field that are not written to Dart final fields and also to field initializers, even if there are no property for them.

4. And constant enums.

5. pkg/code_transformers/test/resolver_test has to be skipped, I cannot fix it myself.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//214253002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34474 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-27 15:37:37 +00:00
scheglov@google.com a674327095 Translate private Java members to private Dart members.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//189803004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33453 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 20:59:57 +00:00