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

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

Issue 170313008: - Restore the better error message. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months 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 | « runtime/vm/dart_api_impl_test.cc ('k') | 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) 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 "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 5329 matching lines...) Expand 10 before | Expand all | Expand 10 after
5340 // Parse the function name out. 5340 // Parse the function name out.
5341 const intptr_t native_pos = TokenPos(); 5341 const intptr_t native_pos = TokenPos();
5342 const String& native_name = ParseNativeDeclaration(); 5342 const String& native_name = ParseNativeDeclaration();
5343 5343
5344 // Now resolve the native function to the corresponding native entrypoint. 5344 // Now resolve the native function to the corresponding native entrypoint.
5345 const int num_params = NativeArguments::ParameterCountForResolution(func); 5345 const int num_params = NativeArguments::ParameterCountForResolution(func);
5346 bool auto_setup_scope = true; 5346 bool auto_setup_scope = true;
5347 NativeFunction native_function = NativeEntry::ResolveNative( 5347 NativeFunction native_function = NativeEntry::ResolveNative(
5348 library, native_name, num_params, &auto_setup_scope); 5348 library, native_name, num_params, &auto_setup_scope);
5349 if (native_function == NULL) { 5349 if (native_function == NULL) {
5350 ErrorMsg(native_pos, "native function '%s' cannot be found", 5350 ErrorMsg(native_pos,
5351 native_name.ToCString()); 5351 "native function '%s' (%" Pd " arguments) cannot be found",
5352 native_name.ToCString(), func.NumParameters());
5352 } 5353 }
5353 func.SetIsNativeAutoSetupScope(auto_setup_scope); 5354 func.SetIsNativeAutoSetupScope(auto_setup_scope);
5354 5355
5355 // Now add the NativeBodyNode and return statement. 5356 // Now add the NativeBodyNode and return statement.
5356 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); 5357 Dart_NativeEntryResolver resolver = library.native_entry_resolver();
5357 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); 5358 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
5358 current_block_->statements->Add( 5359 current_block_->statements->Add(
5359 new ReturnNode(TokenPos(), 5360 new ReturnNode(TokenPos(),
5360 new NativeBodyNode(TokenPos(), 5361 new NativeBodyNode(TokenPos(),
5361 Function::ZoneHandle(func.raw()), 5362 Function::ZoneHandle(func.raw()),
(...skipping 5413 matching lines...) Expand 10 before | Expand all | Expand 10 after
10775 void Parser::SkipQualIdent() { 10776 void Parser::SkipQualIdent() {
10776 ASSERT(IsIdentifier()); 10777 ASSERT(IsIdentifier());
10777 ConsumeToken(); 10778 ConsumeToken();
10778 if (CurrentToken() == Token::kPERIOD) { 10779 if (CurrentToken() == Token::kPERIOD) {
10779 ConsumeToken(); // Consume the kPERIOD token. 10780 ConsumeToken(); // Consume the kPERIOD token.
10780 ExpectIdentifier("identifier expected after '.'"); 10781 ExpectIdentifier("identifier expected after '.'");
10781 } 10782 }
10782 } 10783 }
10783 10784
10784 } // namespace dart 10785 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698