Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 9325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9336 } | 9336 } |
| 9337 | 9337 |
| 9338 | 9338 |
| 9339 void Parser::SkipBinaryExpr() { | 9339 void Parser::SkipBinaryExpr() { |
| 9340 SkipUnaryExpr(); | 9340 SkipUnaryExpr(); |
| 9341 const int min_prec = Token::Precedence(Token::kOR); | 9341 const int min_prec = Token::Precedence(Token::kOR); |
| 9342 const int max_prec = Token::Precedence(Token::kMUL); | 9342 const int max_prec = Token::Precedence(Token::kMUL); |
| 9343 while (((min_prec <= Token::Precedence(CurrentToken())) && | 9343 while (((min_prec <= Token::Precedence(CurrentToken())) && |
| 9344 (Token::Precedence(CurrentToken()) <= max_prec)) || | 9344 (Token::Precedence(CurrentToken()) <= max_prec)) || |
| 9345 IsLiteral("as")) { | 9345 IsLiteral("as")) { |
| 9346 ConsumeToken(); | 9346 if (CurrentToken() == Token::kIS) { |
|
hausner
2012/08/31 23:31:35
I think there is another bug here. After the keywo
| |
| 9347 SkipUnaryExpr(); | 9347 ConsumeToken(); |
| 9348 if (CurrentToken() == Token::kNOT) { | |
| 9349 ConsumeToken(); | |
| 9350 } | |
| 9351 SkipType(false); | |
| 9352 } else { | |
| 9353 ConsumeToken(); | |
| 9354 SkipUnaryExpr(); | |
| 9355 } | |
| 9348 } | 9356 } |
| 9349 } | 9357 } |
| 9350 | 9358 |
| 9351 | 9359 |
| 9352 void Parser::SkipConditionalExpr() { | 9360 void Parser::SkipConditionalExpr() { |
| 9353 SkipBinaryExpr(); | 9361 SkipBinaryExpr(); |
| 9354 if (CurrentToken() == Token::kCONDITIONAL) { | 9362 if (CurrentToken() == Token::kCONDITIONAL) { |
| 9355 ConsumeToken(); | 9363 ConsumeToken(); |
| 9356 SkipExpr(); | 9364 SkipExpr(); |
| 9357 ExpectToken(Token::kCOLON); | 9365 ExpectToken(Token::kCOLON); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 9382 void Parser::SkipQualIdent() { | 9390 void Parser::SkipQualIdent() { |
| 9383 ASSERT(IsIdentifier()); | 9391 ASSERT(IsIdentifier()); |
| 9384 ConsumeToken(); | 9392 ConsumeToken(); |
| 9385 if (CurrentToken() == Token::kPERIOD) { | 9393 if (CurrentToken() == Token::kPERIOD) { |
| 9386 ConsumeToken(); // Consume the kPERIOD token. | 9394 ConsumeToken(); // Consume the kPERIOD token. |
| 9387 ExpectIdentifier("identifier expected after '.'"); | 9395 ExpectIdentifier("identifier expected after '.'"); |
| 9388 } | 9396 } |
| 9389 } | 9397 } |
| 9390 | 9398 |
| 9391 } // namespace dart | 9399 } // namespace dart |
| OLD | NEW |