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

Side by Side Diff: runtime/vm/parser.cc

Issue 10830130: Properly skip expressions that contain the operator as. (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/type_cast_vm_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 8814 matching lines...) Expand 10 before | Expand all | Expand 10 after
8825 ConsumeToken(); 8825 ConsumeToken();
8826 SkipUnaryExpr(); 8826 SkipUnaryExpr();
8827 } else { 8827 } else {
8828 SkipPostfixExpr(); 8828 SkipPostfixExpr();
8829 } 8829 }
8830 } 8830 }
8831 8831
8832 8832
8833 void Parser::SkipBinaryExpr() { 8833 void Parser::SkipBinaryExpr() {
8834 SkipUnaryExpr(); 8834 SkipUnaryExpr();
8835 while (Token::Precedence(Token::kOR) <= Token::Precedence(CurrentToken()) && 8835 const int min_prec = Token::Precedence(Token::kOR);
8836 Token::Precedence(CurrentToken()) <= Token::Precedence(Token::kMUL)) { 8836 const int max_prec = Token::Precedence(Token::kMUL);
8837 while (((min_prec <= Token::Precedence(CurrentToken())) &&
8838 (Token::Precedence(CurrentToken()) <= max_prec)) ||
8839 IsLiteral("as")) {
8837 ConsumeToken(); 8840 ConsumeToken();
8838 SkipUnaryExpr(); 8841 SkipUnaryExpr();
8839 } 8842 }
8840 } 8843 }
8841 8844
8842 8845
8843 void Parser::SkipConditionalExpr() { 8846 void Parser::SkipConditionalExpr() {
8844 SkipBinaryExpr(); 8847 SkipBinaryExpr();
8845 if (CurrentToken() == Token::kCONDITIONAL) { 8848 if (CurrentToken() == Token::kCONDITIONAL) {
8846 ConsumeToken(); 8849 ConsumeToken();
(...skipping 26 matching lines...) Expand all
8873 void Parser::SkipQualIdent() { 8876 void Parser::SkipQualIdent() {
8874 ASSERT(IsIdentifier()); 8877 ASSERT(IsIdentifier());
8875 ConsumeToken(); 8878 ConsumeToken();
8876 if (CurrentToken() == Token::kPERIOD) { 8879 if (CurrentToken() == Token::kPERIOD) {
8877 ConsumeToken(); // Consume the kPERIOD token. 8880 ConsumeToken(); // Consume the kPERIOD token.
8878 ExpectIdentifier("identifier expected after '.'"); 8881 ExpectIdentifier("identifier expected after '.'");
8879 } 8882 }
8880 } 8883 }
8881 8884
8882 } // namespace dart 8885 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/type_cast_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698