| 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 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1843 ConsumeToken(); | 1843 ConsumeToken(); |
| 1844 const intptr_t expr_pos = token_index_; | 1844 const intptr_t expr_pos = token_index_; |
| 1845 AstNode* expr = ParseExpr(kAllowConst); | 1845 AstNode* expr = ParseExpr(kAllowConst); |
| 1846 ASSERT(expr != NULL); | 1846 ASSERT(expr != NULL); |
| 1847 current_block_->statements->Add(new ReturnNode(expr_pos, expr)); | 1847 current_block_->statements->Add(new ReturnNode(expr_pos, expr)); |
| 1848 } else if (IsLiteral("native")) { | 1848 } else if (IsLiteral("native")) { |
| 1849 ParseNativeFunctionBlock(¶ms, func); | 1849 ParseNativeFunctionBlock(¶ms, func); |
| 1850 } else { | 1850 } else { |
| 1851 UnexpectedToken(); | 1851 UnexpectedToken(); |
| 1852 } | 1852 } |
| 1853 current_block_->statements->Add(CloseBlock()); | 1853 SequenceNode* body = CloseBlock(); |
| 1854 SequenceNode* statements = CloseBlock(); | 1854 current_block_->statements->Add(body); |
| 1855 return statements; | 1855 return CloseBlock(); |
| 1856 } | 1856 } |
| 1857 | 1857 |
| 1858 | 1858 |
| 1859 void Parser::SkipIf(Token::Kind token) { | 1859 void Parser::SkipIf(Token::Kind token) { |
| 1860 if (CurrentToken() == token) { | 1860 if (CurrentToken() == token) { |
| 1861 ConsumeToken(); | 1861 ConsumeToken(); |
| 1862 } | 1862 } |
| 1863 } | 1863 } |
| 1864 | 1864 |
| 1865 | 1865 |
| (...skipping 5827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7693 } | 7693 } |
| 7694 | 7694 |
| 7695 | 7695 |
| 7696 void Parser::SkipNestedExpr() { | 7696 void Parser::SkipNestedExpr() { |
| 7697 const bool saved_mode = SetAllowFunctionLiterals(true); | 7697 const bool saved_mode = SetAllowFunctionLiterals(true); |
| 7698 SkipExpr(); | 7698 SkipExpr(); |
| 7699 SetAllowFunctionLiterals(saved_mode); | 7699 SetAllowFunctionLiterals(saved_mode); |
| 7700 } | 7700 } |
| 7701 | 7701 |
| 7702 } // namespace dart | 7702 } // namespace dart |
| OLD | NEW |