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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.java

Issue 10702119: Issue 2622. Fix for SourceInfo for DartUnit for one case of invalid source (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Balance begin/done when parsing arguments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index f881689a29a40e276dc0d923c5f00308f7f23bb0..7c514861aeb814a438be24af82d50e051fd3548a 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -2182,11 +2182,11 @@ public class DartParser extends CompletionHooksParserBase {
@Terminals(tokens={Token.RPAREN, Token.COMMA})
public List<DartExpression> parseArguments() {
List<DartExpression> arguments = new ArrayList<DartExpression>();
- expect(Token.LPAREN);
// SEMICOLON is for error recovery
boolean namedArgumentParsed = false;
outer: while (!match(Token.RPAREN) && !match(Token.EOS) && !match(Token.SEMICOLON)) {
beginParameter();
+ // parse single parameter, may be named with default
DartExpression expression;
if (peek(1) == Token.COLON) {
DartIdentifier name = parseIdentifier();
@@ -2199,9 +2199,13 @@ public class DartParser extends CompletionHooksParserBase {
reportError(expression, ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT);
}
}
+ // done with parameter
+ done(expression);
+ // may be add
if (expression != null) {
- arguments.add(done(expression));
+ arguments.add(expression);
}
+ // do we have next parameter?
switch(peek(0)) {
// Must keep in sync with @Terminals above
case COMMA:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698