Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Issue 11953012: Add more mixin tests and start rejecting illegal syntax. (Closed)

Created:
7 years, 11 months ago by kasperl
Modified:
7 years, 11 months ago
Reviewers:
Johnni Winther, ahe
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add more mixin tests and start rejecting illegal syntax. R=johnniwinther@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=17342

Patch Set 1 #

Total comments: 2

Patch Set 2 : Update status files. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -21 lines) Patch
M sdk/lib/_internal/compiler/implementation/elements/modelx.dart View 2 chunks +2 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/enqueue.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/members.dart View 2 chunks +25 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/listener.dart View 1 chunk +3 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/parser.dart View 3 chunks +8 lines, -5 lines 4 comments Download
M sdk/lib/_internal/compiler/implementation/warnings.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 2 chunks +12 lines, -10 lines 0 comments Download
A tests/language/mixin_illegal_syntax_test.dart View 1 chunk +45 lines, -0 lines 0 comments Download
A tests/language/mixin_mixin_test.dart View 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
kasperl
7 years, 11 months ago (2013-01-21 11:08:47 UTC) #1
Johnni Winther
lgtm https://codereview.chromium.org/11953012/diff/1/sdk/lib/_internal/compiler/implementation/scanner/parser.dart File sdk/lib/_internal/compiler/implementation/scanner/parser.dart (right): https://codereview.chromium.org/11953012/diff/1/sdk/lib/_internal/compiler/implementation/scanner/parser.dart#newcode282 sdk/lib/_internal/compiler/implementation/scanner/parser.dart:282: Token parseMixinApplication(Token token, bool isTypedef) { Make isTypedef ...
7 years, 11 months ago (2013-01-21 11:15:22 UTC) #2
kasperl
https://codereview.chromium.org/11953012/diff/1/sdk/lib/_internal/compiler/implementation/scanner/parser.dart File sdk/lib/_internal/compiler/implementation/scanner/parser.dart (right): https://codereview.chromium.org/11953012/diff/1/sdk/lib/_internal/compiler/implementation/scanner/parser.dart#newcode282 sdk/lib/_internal/compiler/implementation/scanner/parser.dart:282: Token parseMixinApplication(Token token, bool isTypedef) { On 2013/01/21 11:15:22, ...
7 years, 11 months ago (2013-01-21 11:16:30 UTC) #3
ahe
DBC https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler/implementation/scanner/parser.dart File sdk/lib/_internal/compiler/implementation/scanner/parser.dart (right): https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler/implementation/scanner/parser.dart#newcode287 sdk/lib/_internal/compiler/implementation/scanner/parser.dart:287: listener.handleModifiers(0); This is a hack. You should let ...
7 years, 11 months ago (2013-01-21 12:38:53 UTC) #4
kasperl
https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler/implementation/scanner/parser.dart File sdk/lib/_internal/compiler/implementation/scanner/parser.dart (right): https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler/implementation/scanner/parser.dart#newcode287 sdk/lib/_internal/compiler/implementation/scanner/parser.dart:287: listener.handleModifiers(0); On 2013/01/21 12:38:53, ahe wrote: > This is ...
7 years, 11 months ago (2013-01-21 12:46:16 UTC) #5
ahe
https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler/implementation/scanner/parser.dart File sdk/lib/_internal/compiler/implementation/scanner/parser.dart (right): https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler/implementation/scanner/parser.dart#newcode287 sdk/lib/_internal/compiler/implementation/scanner/parser.dart:287: listener.handleModifiers(0); On 2013/01/21 12:46:16, kasperl wrote: > On 2013/01/21 ...
7 years, 11 months ago (2013-01-21 13:03:10 UTC) #6
kasperl
7 years, 11 months ago (2013-01-21 13:04:46 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/scanner/parser.dart (right):

https://codereview.chromium.org/11953012/diff/3001/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/scanner/parser.dart:287:
listener.handleModifiers(0);
On 2013/01/21 13:03:10, ahe wrote:
> On 2013/01/21 12:46:16, kasperl wrote:
> > On 2013/01/21 12:38:53, ahe wrote:
> > > This is a hack. You should let endMixinApplication know that there are no
> > > modifiers instead.
> > > 
> > > Also, I have generally tried to let the parser accept as much as possible,
> and
> > > let later phases report errors. This gives better error recovery.
> > 
> > Ah, okay. In that case, it's a hack used in at least one other part of the
> > parser not written by me and without any TODOs or indications that it's a
> hack.
> 
> Yes. I'm not sure I realized it the time, but it became painfully clear that
> parseFunctionExpression is a hack when I looked at how to address
> http://dartbug.com/6708.
> 
> parseFunctionBody and parseLiteralListOrMap do something similar, and it
always
> causes problems.
> 
> This call in parseLiteralListOrMap:
> 
>   listener.handleLiteralList(0, token, constKeyword, token);
> 
> causes problems for unparsing.
> 
> This call inparseFunctionBody:
> 
>   listener.endFunctionBody(0, null, token);
> 
> Means that the listener has to guess what to do based on weird argument
> combinations:
> 
>   void endFunctionBody(int count, Token beginToken, Token endToken) {
>     if (count == 0 && beginToken == null) {
>       pushNode(new EmptyStatement(endToken));
>     } else {
>       pushNode(new Block(makeNodeList(count, beginToken, endToken, null)));
>     }
>   }
> 
> It seemed like a good idea at the time, but it wasn't :-(

Yeah, that is pretty nasty. I'll try to address it by always allowing modifiers
and weed them out (report them) later during resolution.

Powered by Google App Engine
This is Rietveld 408576698