Commit graph

10 commits

Author SHA1 Message Date
Erik Ernst a9ea9365ad Change null-aware operator [], operator []=, and function call to not have a period.
Change-Id: I8b9c83e216dd713afeef8a1c1cf93c36c8de3792
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132840
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-01-22 10:18:26 +00:00
Erik Ernst 6826faf583 Update spec_parser.
Update spec_parser to enable configurableUri in deferred imports,
make cascade syntax compositional, include `extension` declarations,
add `late` as a built-in identifier, and reorder the lexical rules for
single words such that they are grouped into reserved words, built-in
identifiers, and "other words known by the grammar".

Cf. language issue #615, #627, #628, #638.

Change-Id: If60b2ba2ca0e7d4bbc9b4e886857f657fb14c809
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121991
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-10-25 08:57:44 +00:00
Erik Ernst a58052974e Adjusted Dart.g to contain the grammar updates of language repo PR 293
This CL makes several adjustments to the spec_parser grammar Dart.g,
such that the spec_parser can parse the proposed NNBD constructs,
cf. language PR #293.

Change-Id: Ieec00259d73b6037d6a87d5c97cfac40186baef0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101500
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-08-14 08:17:54 +00:00
Erik Ernst 56793b3d47 Dart.g fixes, not including nnbd updates.
Change-Id: Ibbc6f5f811ed0cc042340254dce10616c0600fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105220
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-06-06 12:07:40 +00:00
Erik Ernst 69790e7eb4 Updated Dart.g, tests & status files to support ui-as-code collections
Change-Id: I9ba3aa4e3ebaedee3a2cd20ccdcc533af96b9bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98018
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-03-29 13:33:52 +00:00
Erik Ernst e830338919 Updated spec_parser such that it runs with ANTLR v4
Change-Id: Ib0711ebc125f4fadb5a526c3538d5c3a35f11234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97320
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-03-19 14:06:26 +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
Erik Ernst 63de49ccde test.py will now run the spec parser.
This CL modifies tools/test.py such that it can run the spec parser
(after doing `make parser` in tools/spec_parser, and assuming that the
ANTLR 3 library is available at /usr/share/java/antlr3-runtime.jar)
with a command line like

  `tools/test.py -c spec_parser -r none language/callable_test`

It also changes status files to have a name which follows the expected
patterns (e.g., `language/language_spec_parser.status`). Finally, it
adds/changes many entries in status files, such that parsing of the
directories `language` and `language_2` run successfully.

Change-Id: I82a22e32ac4fecd23ac0d4434bcac08f75dd8ffe
Reviewed-on: https://dart-review.googlesource.com/12680
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-10-12 09:22:28 +00:00
Erik Ernst b61f1047d5 Add a tools/spec_parse.py script.
This makes it possible to run the spec parser in a way which is a bit
more like the other tools that we have (e.g., tools/test.py):

  > tools/spec_parse.py tests/language/callable_test.dart

It still requires the developer to run `make parser` in
tools/spec_parser and hence does not run on a buildbot, but it's one
step forward.

Change-Id: I68ad6cea55bc02dddac21558acec33fc4bfc1981
Reviewed-on: https://dart-review.googlesource.com/9620
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-10-10 16:03:36 +00:00
Erik Ernst c49cbae7f0 Rietveld 2688903004 (spec_parser) migrated to Gerrit.
Change-Id: Iddd1e8a795bfaed0092a30bb9d83070fe62d4a60
Reviewed-on: https://dart-review.googlesource.com/7261
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-09-21 09:36:10 +00:00