Commit Graph

11 Commits

Author SHA1 Message Date
Johnni Winther 63373b9e9c [cfe,analyzer] Pass message arguments directly to AnalysisError
This allows for supporting customized message for scanner/parser
errors.

Change-Id: Ib9470c3d8231de69611bc672570ae8902e9c0e6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-11 16:45:26 +00:00
Jens Johansen 7e42cbf582 [parser] Change recovery of multiple extends with comma
E.g. class Foo extends Bar, Baz {} would before have parsed weirdly,
but it will parse as you'd (probably) expect with an error saying
you cannot do that. For now at least both CFE and Analyzer will
pretend like you just specified the first one but I suppose Analyzer
could for instance use the extra information to propose converting
other ones to implements clauses or similar.

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

Change-Id: I180cdd8ab07143dd74fd21c9976ec2a46c428d8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158261
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-13 08:49:53 +00:00
Paul Berry 8cb7dfa70f Modify parser to handle abstract fields.
There is no functional change to the analyzer or CFE yet; we simply
report the error in the parser listeners now rather than the parser
itself.  In follow up CLs when we add full support for the feature, we
will want to keep the error reporting logic, but only report the
errors in pre-NNBD code.

Change-Id: Ifd14dd97d7d1d57586a8e14a25103356d54f0ea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154364
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-07-15 22:48:01 +00:00
Jens Johansen 5b76fc2172 [parser] Better recovery of methods/fields called 'const', 'final', 'var' or 'void'
Change-Id: I370089a6de8c585a60785fe069de5da869ae23f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145820
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-06 11:56:24 +00:00
Karl Klose bd06f1bf51 [cfe/infra] Unit test suites: print re-run command when a test fails
Closes #39423

Change-Id: Ifa3fbe4d670f4f95beceb2aae8769a553a9fbe7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125604
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-22 10:45:54 +00:00
Jens Johansen fa05fedd89 [CFE] Parser test suite prints messages prettily at top of expect file
Change-Id: I9af28f57f8ab54b38e34b06019000b720e5fdecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123524
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-30 14:25:54 +00:00
Jens Johansen 5b7c981086 [CFE] Parser test framework also outputs token stream
This makes it much easier to see what the parser is actually working
with in the face of token stream rewrites.

Change-Id: Ic336f18fab7c8fd7a42020b32af4a480bbde25bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122865
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-28 10:25:30 +00:00
Jens Johansen 8c041c8f8f [parser] Don't clear extraneous covariant token
Change-Id: Ieb722e28001533564668d798cf76748bd25590f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121323
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-18 13:14:28 +00:00
Jens Johansen 8d4c5c6f65 [CFE] Add toString on Message for better debugging
If nothing else, it makes parser tests with recorable errors much more
informative.

Change-Id: I12759965d171c1289de1633c63e294779c1986a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121322
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-11 13:18:13 +00:00
Jens Johansen 8f477fd84a [parser] Disallow covariant on extension method parameters
Fixes #38560.

Change-Id: I4c941fb6713983cc01efbe143c7924d0643efe73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119332
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-08 13:01:40 +00:00
Jens Johansen 396608e35d [CFE] Update parser test framework to work with extensions
Change-Id: I7e3fa005470a66e33da12ee71235020fb53e8767
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-03 08:29:51 +00:00