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

Issue 8774024: Parse method names that include type variables. (Closed)

Created:
9 years ago by zundel
Modified:
9 years ago
Reviewers:
mmendez, codefu
CC:
reviews_dartlang.org, Ivan Posva
Visibility:
Public.

Description

Parse method names that include type variables. As a first step to allow factory methods to specify type variables, this allows the parser to accept statements similar to the form: class A { factory B<T>.create() { } } http://code.google.com/p/dart/issues/detail?id=417 Committed: https://code.google.com/p/dart/source/detail?r=2004 Committed: https://code.google.com/p/dart/source/detail?r=2024

Patch Set 1 #

Total comments: 13

Patch Set 2 : Feedback from mmedendez #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -13 lines) Patch
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 1 2 chunks +8 lines, -13 lines 2 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java View 1 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
zundel
http://codereview.chromium.org/8774024/diff/1/compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java File compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java (right): http://codereview.chromium.org/8774024/diff/1/compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java#newcode148 compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java:148: State.RollbackToken token = oldState.rollbackTokens.pop(); Found a bug in this ...
9 years ago (2011-12-01 23:45:54 UTC) #1
zundel
committed TBR r2004 I am still working on the validation and codegen part of this ...
9 years ago (2011-12-01 23:47:32 UTC) #2
mmendez
LGTM - just take a look at the nits. http://codereview.chromium.org/8774024/diff/1/compiler/java/com/google/dart/compiler/parser/DartParser.java File compiler/java/com/google/dart/compiler/parser/DartParser.java (left): http://codereview.chromium.org/8774024/diff/1/compiler/java/com/google/dart/compiler/parser/DartParser.java#oldcode896 compiler/java/com/google/dart/compiler/parser/DartParser.java:896: ...
9 years ago (2011-12-02 13:20:13 UTC) #3
zundel
I've updated a few changes since the commit to address Miguel's concerns, and added 2 ...
9 years ago (2011-12-02 13:46:02 UTC) #4
codefu
9 years ago (2011-12-02 13:51:21 UTC) #5
LGTM

http://codereview.chromium.org/8774024/diff/1/compiler/java/com/google/dart/c...
File compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java
(right):

http://codereview.chromium.org/8774024/diff/1/compiler/java/com/google/dart/c...
compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java:148:
State.RollbackToken token = oldState.rollbackTokens.pop();
On 2011/12/01 23:45:54, zundel wrote:
> Found a bug in this logic when rolling back >>> parsed as the closing braces
for
> type arguments - the old for loop unrolled the state in the wrong order.

Thanks for catching this!

http://codereview.chromium.org/8774024/diff/2002/compiler/java/com/google/dar...
File compiler/java/com/google/dart/compiler/parser/DartParser.java (right):

http://codereview.chromium.org/8774024/diff/2002/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/parser/DartParser.java:964: // Case 2, a
constructor of the form library.class.<typearguments?>.id
There's no more case 1 prior to this comment.

http://codereview.chromium.org/8774024/diff/2002/compiler/java/com/google/dar...
compiler/java/com/google/dart/compiler/parser/DartParser.java:967:
parseTypeArgumentsOpt();
ws

Powered by Google App Engine
This is Rietveld 408576698