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

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

Issue 10911042: Fixed parsing of parameterized type test assert statement in production mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « runtime/tests/vm/dart/assert_with_type_test_or_cast_test.dart ('k') | no next file » | 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 9318 matching lines...) Expand 10 before | Expand all | Expand 10 after
9329 } 9329 }
9330 9330
9331 9331
9332 void Parser::SkipBinaryExpr() { 9332 void Parser::SkipBinaryExpr() {
9333 SkipUnaryExpr(); 9333 SkipUnaryExpr();
9334 const int min_prec = Token::Precedence(Token::kOR); 9334 const int min_prec = Token::Precedence(Token::kOR);
9335 const int max_prec = Token::Precedence(Token::kMUL); 9335 const int max_prec = Token::Precedence(Token::kMUL);
9336 while (((min_prec <= Token::Precedence(CurrentToken())) && 9336 while (((min_prec <= Token::Precedence(CurrentToken())) &&
9337 (Token::Precedence(CurrentToken()) <= max_prec)) || 9337 (Token::Precedence(CurrentToken()) <= max_prec)) ||
9338 IsLiteral("as")) { 9338 IsLiteral("as")) {
9339 Token::Kind last_token = IsLiteral("as") ? Token::kAS : CurrentToken();
9339 ConsumeToken(); 9340 ConsumeToken();
9340 SkipUnaryExpr(); 9341 if (last_token == Token::kIS) {
9342 if (CurrentToken() == Token::kNOT) {
9343 ConsumeToken();
9344 }
9345 SkipType(false);
9346 } else if (last_token == Token::kAS) {
9347 SkipType(false);
9348 } else {
9349 SkipUnaryExpr();
9350 }
9341 } 9351 }
9342 } 9352 }
9343 9353
9344 9354
9345 void Parser::SkipConditionalExpr() { 9355 void Parser::SkipConditionalExpr() {
9346 SkipBinaryExpr(); 9356 SkipBinaryExpr();
9347 if (CurrentToken() == Token::kCONDITIONAL) { 9357 if (CurrentToken() == Token::kCONDITIONAL) {
9348 ConsumeToken(); 9358 ConsumeToken();
9349 SkipExpr(); 9359 SkipExpr();
9350 ExpectToken(Token::kCOLON); 9360 ExpectToken(Token::kCOLON);
(...skipping 24 matching lines...) Expand all
9375 void Parser::SkipQualIdent() { 9385 void Parser::SkipQualIdent() {
9376 ASSERT(IsIdentifier()); 9386 ASSERT(IsIdentifier());
9377 ConsumeToken(); 9387 ConsumeToken();
9378 if (CurrentToken() == Token::kPERIOD) { 9388 if (CurrentToken() == Token::kPERIOD) {
9379 ConsumeToken(); // Consume the kPERIOD token. 9389 ConsumeToken(); // Consume the kPERIOD token.
9380 ExpectIdentifier("identifier expected after '.'"); 9390 ExpectIdentifier("identifier expected after '.'");
9381 } 9391 }
9382 } 9392 }
9383 9393
9384 } // namespace dart 9394 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/assert_with_type_test_or_cast_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698