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

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

Issue 8450016: Experimental version without native constructor support (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month 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 | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 new StaticCallNode(token_index_, super_ctor, super_call_args)); 1723 new StaticCallNode(token_index_, super_ctor, super_call_args));
1724 } 1724 }
1725 1725
1726 if (CurrentToken() == Token::kLBRACE) { 1726 if (CurrentToken() == Token::kLBRACE) {
1727 ConsumeToken(); 1727 ConsumeToken();
1728 ParseStatementSequence(); 1728 ParseStatementSequence();
1729 ExpectToken(Token::kRBRACE); 1729 ExpectToken(Token::kRBRACE);
1730 } else if (CurrentToken() == Token::kARROW) { 1730 } else if (CurrentToken() == Token::kARROW) {
1731 ErrorMsg("constructors may not return a value"); 1731 ErrorMsg("constructors may not return a value");
1732 } else if (IsLiteral("native")) { 1732 } else if (IsLiteral("native")) {
1733 ParseNativeFunctionBlock(&params, func); 1733 ErrorMsg("native constructors not supported");
1734 } else if (CurrentToken() == Token::kSEMICOLON) { 1734 } else if (CurrentToken() == Token::kSEMICOLON) {
1735 // Some constructors have no function body. 1735 // Some constructors have no function body.
1736 ConsumeToken(); 1736 ConsumeToken();
1737 } else { 1737 } else {
1738 UnexpectedToken(); 1738 UnexpectedToken();
1739 } 1739 }
1740 1740
1741 SequenceNode* ctor_block = CloseBlock(); 1741 SequenceNode* ctor_block = CloseBlock();
1742 if (ctor_block->length() > 0) { 1742 if (ctor_block->length() > 0) {
1743 // Generate guard around the constructor body code. 1743 // Generate guard around the constructor body code.
(...skipping 5503 matching lines...) Expand 10 before | Expand all | Expand 10 after
7247 } 7247 }
7248 7248
7249 7249
7250 void Parser::SkipNestedExpr() { 7250 void Parser::SkipNestedExpr() {
7251 const bool saved_mode = SetAllowFunctionLiterals(true); 7251 const bool saved_mode = SetAllowFunctionLiterals(true);
7252 SkipExpr(); 7252 SkipExpr();
7253 SetAllowFunctionLiterals(saved_mode); 7253 SetAllowFunctionLiterals(saved_mode);
7254 } 7254 }
7255 7255
7256 } // namespace dart 7256 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698