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

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

Issue 10828169: 'Split && condition' quick assist. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
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 bffce4e3afd1b143c4eac185f6ea8acfaf8d2967..c7b2abd0e21bf5fd168ddb98be209d316a1a6f90 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -4177,12 +4177,15 @@ public class DartParser extends CompletionHooksParserBase {
expect(Token.LPAREN);
DartExpression condition = parseExpression();
expectCloseParen();
+ int closeParentOffset = ctx.getTokenLocation().getBegin();
DartStatement yes = parseStatement();
DartStatement no = null;
+ int elseTokenOffset = 0;
if (optional(Token.ELSE)) {
+ elseTokenOffset = ctx.getTokenLocation().getBegin();
no = parseStatement();
}
- return done(new DartIfStatement(condition, yes, no));
+ return done(new DartIfStatement(condition, closeParentOffset, yes, elseTokenOffset, no));
}
/**

Powered by Google App Engine
This is Rietveld 408576698