Chromium Code Reviews| 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 6371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6382 String& errmsg = String::Handle(); | 6382 String& errmsg = String::Handle(); |
| 6383 type = ClassFinalizer::FinalizeAndCanonicalizeType(type, &errmsg); | 6383 type = ClassFinalizer::FinalizeAndCanonicalizeType(type, &errmsg); |
| 6384 if (!errmsg.IsNull()) { | 6384 if (!errmsg.IsNull()) { |
| 6385 ErrorMsg(errmsg.ToCString()); | 6385 ErrorMsg(errmsg.ToCString()); |
| 6386 } | 6386 } |
| 6387 } | 6387 } |
| 6388 return type.raw(); | 6388 return type.raw(); |
| 6389 } | 6389 } |
| 6390 | 6390 |
| 6391 | 6391 |
| 6392 void Parser::CheckConstructorCallTypeArguments( | 6392 void Parser::CheckConstructorCallTypeArguments( |
|
regis
2011/11/11 18:47:13
How about removing this function alltogether? It w
srdjan
2011/11/11 18:49:19
I try the fix you suggested (implement) and reenab
| |
| 6393 intptr_t pos, Function& constructor, const TypeArguments& type_arguments) { | 6393 intptr_t pos, Function& constructor, const TypeArguments& type_arguments) { |
| 6394 if (!type_arguments.IsNull() && | 6394 if (!type_arguments.IsNull() && |
| 6395 (type_arguments.Length() != | 6395 (type_arguments.Length() != |
| 6396 Class::Handle(constructor.owner()).NumTypeArguments())) { | 6396 Class::Handle(constructor.owner()).NumTypeArguments())) { |
| 6397 ErrorMsg(pos, "Incorrect number of type arguments, expected %d got %d", | 6397 // TODO(regis): report proper error once we can. |
| 6398 Class::Handle(constructor.owner()).NumTypeArguments(), | 6398 // ErrorMsg(pos, "Incorrect number of type arguments, expected %d got %d", |
| 6399 type_arguments.Length()); | 6399 // Class::Handle(constructor.owner()).NumTypeArguments(), |
| 6400 // type_arguments.Length()); | |
| 6400 } | 6401 } |
| 6401 } | 6402 } |
| 6402 | 6403 |
| 6403 | 6404 |
| 6404 // Parse "[" [ expr { "," expr } ["," ] "]". | 6405 // Parse "[" [ expr { "," expr } ["," ] "]". |
| 6405 // Note: if the array literal is empty and the brackets have no whitespace | 6406 // Note: if the array literal is empty and the brackets have no whitespace |
| 6406 // between them, the scanner recognizes the opening and closing bracket | 6407 // between them, the scanner recognizes the opening and closing bracket |
| 6407 // as one token of type Token::kINDEX. | 6408 // as one token of type Token::kINDEX. |
| 6408 AstNode* Parser::ParseArrayLiteral(intptr_t type_pos, | 6409 AstNode* Parser::ParseArrayLiteral(intptr_t type_pos, |
| 6409 bool is_const, | 6410 bool is_const, |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7284 } | 7285 } |
| 7285 | 7286 |
| 7286 | 7287 |
| 7287 void Parser::SkipNestedExpr() { | 7288 void Parser::SkipNestedExpr() { |
| 7288 const bool saved_mode = SetAllowFunctionLiterals(true); | 7289 const bool saved_mode = SetAllowFunctionLiterals(true); |
| 7289 SkipExpr(); | 7290 SkipExpr(); |
| 7290 SetAllowFunctionLiterals(saved_mode); | 7291 SetAllowFunctionLiterals(saved_mode); |
| 7291 } | 7292 } |
| 7292 | 7293 |
| 7293 } // namespace dart | 7294 } // namespace dart |
| OLD | NEW |