Commit Graph

16 Commits

Author SHA1 Message Date
Dan Rubel a8bf40399f Update fasta parser to report error on static constructor
This refactors how modifiers are passed to listener so that the
OutlineBuilder can report a static constructor error.

* Remove handleModifier/s calls from parseMethod
* Pass name and modifiers in beginMethod event
* Update listeners to process method modifiers in beginMethod event
    * AstBuilder
    * NodeListener
    * OutlineBuilder
* Address comment in https://dart-review.googlesource.com/c/sdk/+/42800

Change-Id: Iabd4a18613c1814eb5a157df4acf60dd9060d5eb
Reviewed-on: https://dart-review.googlesource.com/43120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-23 13:18:46 +00:00
Erik Ernst 40b6741778 Adds support for syntax error in tests to test.py.
This CL modifies the Dart source used from test.py such that it takes
`syntax error` into account as an expected outcome in test files (so
that we can have `//# 01: syntax error` with a similar meaning as
`//# 01: compile-time error`).

For all tools except the spec_parser, `syntax error` is the same
outcome as `compile-time error`; that is, nobody else will see the
difference.

For the spec_parser, `syntax error` is the outcome where parsing has
failed; `compile-time error` is taken to mean some other compile-time
error, i.e., the spec_parser is expected to _succeed_ when the
expected outcome is `compile-time error`.

Test files in language and language_2 have been adjusted to use the
outcome `syntax error` where appropriate.

The status files in language and language_2 for the spec_parser have
been adjusted such that they fit all the new `syntax error` outcomes
in test files.

Other status files have been adjusted in a few cases where tests were
corrected (because a compile-time error which was clearly not intended
to be a syntax error turned out to be caused by a typo, which means
that the actual compile-time error has never been tested).

The spec grammar Dart.g was adjusted in a few cases, when some bugs
were discovered. In particular, the treatment of Function has been
changed: It is now known by the parser that Function does not take
any type arguments. This makes no difference for developers, because
they cannot declare a type named Function anyway, but it means that
a number of tricky parsing issues were resolved.

Dart.g was also adjusted to allow `qualified` to contain three
identifiers, which is an old bug (preventing things like metadata on
the form `@p.C.myConst`).

Change-Id: Ie420887d45c882ef97c84143365219f8aa0d2933
Reviewed-on: https://dart-review.googlesource.com/18262
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-11-06 08:56:09 +00:00
Bob Nystrom 14011f47e3 Resurrect deleted language tests.
They're back from the grave, and ready to party!

Change-Id: I088134a9be7ecabf1fbf751c015a656a15cabff9
Reviewed-on: https://dart-review.googlesource.com/12821
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-10-11 17:47:11 +00:00
Bob Nystrom 3c7f9852a5 Migrate block 43.
R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2990933002 .
2017-08-01 16:58:52 -07:00
Jacob Richman 14531fa62d Re-land "Format all multitests"
Only delta from the original is a bad merge of tests/corelib/list_test.dart

This reverts commit 44d8be0ed3.

BUG=

Review-Url: https://codereview.chromium.org/2774783002 .
2017-03-23 12:40:21 -07:00
Jacob Richman 44d8be0ed3 Revert "Format all multitests"
This reverts commit 312b66dd5f.

BUG=

Review-Url: https://codereview.chromium.org/2770063002 .
2017-03-23 10:49:40 -07:00
Jacob Richman 312b66dd5f Format all multitests
BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2768073002 .
2017-03-23 10:26:44 -07:00
Jacob Richman 88eb557b65 Fix warnings_checker.dart handling of multitests
Update all tests

Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com
BUG=

Review-Url: https://codereview.chromium.org/2765693002 .
Review-Url: https://codereview.chromium.org/2765893003 .
2017-03-21 17:29:56 -07:00
Jacob Richman bf2b545150 Revert "Update all tests"
This reverts commit ce76e9c30beaf9a193d3677b88c20a1ebb3fae8c.
2017-03-21 16:33:18 -07:00
Jacob Richman 3c7353d987 Update all tests
Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2765693002 .
2017-03-21 12:39:28 -07:00
Jacob Richman 6a7d6c385e Add comments
Add spaces to make sure dartfmt doesn't destroy bespoke indentation

BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2763823002 .
2017-03-20 21:03:12 -07:00
Asger Feldthaus 76442f9394 Fix language/bad_constructor_test in dartk and analyzer.
The test was incorrect because it did not declare that a static warning
was to be expected due to an unresolved reference to 'q'. The unresolved
reference has been removed as it has nothing to do with what it is
supposed to test.

The analyzer was incorrect in that a setter was reported to clash with
a constructor of the same name, but this failure was hidden by the
above issue. This has been fixed.

dartk inherited the issue (and its fix) from the analyzer, but some
additional error handling was needed in dartk to avoid crashing.

Closes https://github.com/dart-lang/sdk/issues/11576

BUG=
R=kmillikin@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2643693002 .
2017-01-19 13:10:32 +01:00
regis@google.com 42972d1e37 Fix test failure expectations and update status files.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27976 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 22:19:02 +00:00
hausner@google.com abfdec2880 Eliminate explicit abstract from class members in tests
Review URL: https://codereview.chromium.org//11415105

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15220 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-21 20:12:53 +00:00
hausner@google.com e0ed54ea8e Add named constructor name checking
Named constructors may not clash with any other class members.
Add a check but enable it only when --construcotr_name_check
runtime flag is passed to the VM.

Eliminate one named constructor in Process class in core library,
as well as a couple of cases in dart2js.

The dart2js team may want to rename the constructors I changed.

Issue 3990  (http://code.google.com/p/dart/issues/detail?id=3990)
 
Review URL: https://chromiumcodereview.appspot.com//10905109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11972 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 18:02:41 +00:00
hausner@google.com dce2c6a275 Catch illegally declared constructors
Constructors cannot be abstract or static.
Review URL: https://chromiumcodereview.appspot.com//10910079

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11842 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 21:28:48 +00:00