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

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

Issue 1308743006: Revert "This is a fixed up version of:" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | tests/language/assertion_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 "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/ast_transformer.h" 9 #include "vm/ast_transformer.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 9073 matching lines...) Expand 10 before | Expand all | Expand 10 after
9084 } 9084 }
9085 return condition; 9085 return condition;
9086 } 9086 }
9087 9087
9088 9088
9089 AstNode* Parser::ParseAssertStatement() { 9089 AstNode* Parser::ParseAssertStatement() {
9090 TRACE_PARSER("ParseAssertStatement"); 9090 TRACE_PARSER("ParseAssertStatement");
9091 ConsumeToken(); // Consume assert keyword. 9091 ConsumeToken(); // Consume assert keyword.
9092 ExpectToken(Token::kLPAREN); 9092 ExpectToken(Token::kLPAREN);
9093 const intptr_t condition_pos = TokenPos(); 9093 const intptr_t condition_pos = TokenPos();
9094 if (!I->flags().asserts()) { 9094 if (!I->flags().asserts() && !I->flags().type_checks()) {
9095 SkipExpr(); 9095 SkipExpr();
9096 ExpectToken(Token::kRPAREN); 9096 ExpectToken(Token::kRPAREN);
9097 return NULL; 9097 return NULL;
9098 } 9098 }
9099 AstNode* condition = ParseAwaitableExpr(kAllowConst, kConsumeCascades, NULL); 9099 AstNode* condition = ParseAwaitableExpr(kAllowConst, kConsumeCascades, NULL);
9100 const intptr_t condition_end = TokenPos(); 9100 const intptr_t condition_end = TokenPos();
9101 ExpectToken(Token::kRPAREN); 9101 ExpectToken(Token::kRPAREN);
9102 condition = InsertClosureCallNodes(condition); 9102 condition = InsertClosureCallNodes(condition);
9103 condition = new(Z) UnaryOpNode(condition_pos, Token::kNOT, condition); 9103 condition = new(Z) UnaryOpNode(condition_pos, Token::kNOT, condition);
9104 AstNode* assert_throw = MakeAssertCall(condition_pos, condition_end); 9104 AstNode* assert_throw = MakeAssertCall(condition_pos, condition_end);
(...skipping 5177 matching lines...) Expand 10 before | Expand all | Expand 10 after
14282 void Parser::SkipQualIdent() { 14282 void Parser::SkipQualIdent() {
14283 ASSERT(IsIdentifier()); 14283 ASSERT(IsIdentifier());
14284 ConsumeToken(); 14284 ConsumeToken();
14285 if (CurrentToken() == Token::kPERIOD) { 14285 if (CurrentToken() == Token::kPERIOD) {
14286 ConsumeToken(); // Consume the kPERIOD token. 14286 ConsumeToken(); // Consume the kPERIOD token.
14287 ExpectIdentifier("identifier expected after '.'"); 14287 ExpectIdentifier("identifier expected after '.'");
14288 } 14288 }
14289 } 14289 }
14290 14290
14291 } // namespace dart 14291 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/assertion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698