| OLD | NEW |
| 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 Loading... |
| 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(¶ms, 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 Loading... |
| 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 |
| OLD | NEW |