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 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2275 } else if (CurrentToken() == Token::kARROW) { | 2275 } else if (CurrentToken() == Token::kARROW) { |
| 2276 ConsumeToken(); | 2276 ConsumeToken(); |
| 2277 const intptr_t expr_pos = TokenPos(); | 2277 const intptr_t expr_pos = TokenPos(); |
| 2278 AstNode* expr = ParseExpr(kAllowConst, kConsumeCascades); | 2278 AstNode* expr = ParseExpr(kAllowConst, kConsumeCascades); |
| 2279 ASSERT(expr != NULL); | 2279 ASSERT(expr != NULL); |
| 2280 current_block_->statements->Add(new ReturnNode(expr_pos, expr)); | 2280 current_block_->statements->Add(new ReturnNode(expr_pos, expr)); |
| 2281 } else if (IsLiteral("native")) { | 2281 } else if (IsLiteral("native")) { |
| 2282 ParseNativeFunctionBlock(¶ms, func); | 2282 ParseNativeFunctionBlock(¶ms, func); |
| 2283 } else if (func.is_external()) { | 2283 } else if (func.is_external()) { |
| 2284 // Body of an external method contains a single throw. | 2284 // Body of an external method contains a single throw. |
| 2285 const String& function_name = String::Handle(func.name()); | |
|
hausner
2012/10/19 21:43:25
This needs to be a ZoneHandle I think.
hausner
2012/10/19 21:43:25
This needs to be a ZoneHandle I think.
Tom Ball
2012/10/19 22:06:42
Done.
| |
| 2285 current_block_->statements->Add( | 2286 current_block_->statements->Add( |
| 2286 new ThrowNode(TokenPos(), | 2287 ThrowNoSuchMethodError(TokenPos(), function_name)); |
| 2287 new LiteralNode(TokenPos(), | |
| 2288 String::ZoneHandle( | |
| 2289 Symbols::New("External implementation missing."))), NULL)); | |
| 2290 } else { | 2288 } else { |
| 2291 UnexpectedToken(); | 2289 UnexpectedToken(); |
| 2292 } | 2290 } |
| 2293 SequenceNode* body = CloseBlock(); | 2291 SequenceNode* body = CloseBlock(); |
| 2294 current_block_->statements->Add(body); | 2292 current_block_->statements->Add(body); |
| 2295 innermost_function_ = saved_innermost_function.raw(); | 2293 innermost_function_ = saved_innermost_function.raw(); |
| 2296 return CloseBlock(); | 2294 return CloseBlock(); |
| 2297 } | 2295 } |
| 2298 | 2296 |
| 2299 | 2297 |
| (...skipping 7458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9758 void Parser::SkipQualIdent() { | 9756 void Parser::SkipQualIdent() { |
| 9759 ASSERT(IsIdentifier()); | 9757 ASSERT(IsIdentifier()); |
| 9760 ConsumeToken(); | 9758 ConsumeToken(); |
| 9761 if (CurrentToken() == Token::kPERIOD) { | 9759 if (CurrentToken() == Token::kPERIOD) { |
| 9762 ConsumeToken(); // Consume the kPERIOD token. | 9760 ConsumeToken(); // Consume the kPERIOD token. |
| 9763 ExpectIdentifier("identifier expected after '.'"); | 9761 ExpectIdentifier("identifier expected after '.'"); |
| 9764 } | 9762 } |
| 9765 } | 9763 } |
| 9766 | 9764 |
| 9767 } // namespace dart | 9765 } // namespace dart |
| OLD | NEW |