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

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

Issue 340203003: Cleanup of error and warning reporting. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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
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 #ifndef VM_PARSER_H_ 5 #ifndef VM_PARSER_H_
6 #define VM_PARSER_H_ 6 #define VM_PARSER_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 void SkipListLiteral(); 304 void SkipListLiteral();
305 void SkipFunctionLiteral(); 305 void SkipFunctionLiteral();
306 void SkipStringLiteral(); 306 void SkipStringLiteral();
307 void SkipQualIdent(); 307 void SkipQualIdent();
308 void SkipFunctionPreamble(); 308 void SkipFunctionPreamble();
309 309
310 void CheckConstructorCallTypeArguments(intptr_t pos, 310 void CheckConstructorCallTypeArguments(intptr_t pos,
311 const Function& constructor, 311 const Function& constructor,
312 const TypeArguments& type_arguments); 312 const TypeArguments& type_arguments);
313 313
314 // A null script means no source and a negative token_pos means no position. 314 // Report already formatted error.
315 static RawString* FormatMessage(const Script& script, 315 static void ReportError(const Error& error);
316 intptr_t token_pos,
317 LanguageError::Kind kind,
318 const char* format,
319 va_list args);
320 316
321 // Reports error/warning msg at location of current token in current script. 317 // Concatenate and report and already formatted error and a new error message.
srdjan 2014/06/18 21:26:42 s/and/an/
regis 2014/06/18 22:13:28 Done.
322 void ErrorMsg(const char* msg, ...) PRINTF_ATTRIBUTE(2, 3); 318 static void ReportErrors(const Error& error,
323 void Warning(const char* msg, ...) PRINTF_ATTRIBUTE(2, 3); 319 const Script& script, intptr_t token_pos,
324 void Unimplemented(const char* msg); 320 const char* format, ...) PRINTF_ATTRIBUTE(4, 5);
325 321
326 // Reports error message at given location in current script. 322 // Report error message at location of current token in current script.
327 void ErrorMsg(intptr_t token_pos, const char* msg, ...) const 323 void ReportError(const char* msg, ...) const PRINTF_ATTRIBUTE(2, 3);
328 PRINTF_ATTRIBUTE(3, 4);
329 void Warning(intptr_t token_pos, const char* msg, ...)
330 PRINTF_ATTRIBUTE(3, 4);
331 324
332 // Reports an already formatted error message. 325 // Report error message at given location in current script.
333 static void ErrorMsg(const Error& error); 326 void ReportError(intptr_t token_pos,
334 327 const char* msg, ...) const PRINTF_ATTRIBUTE(3, 4);
335 // Concatenates two error messages, the previous and the current one.
336 void AppendErrorMsg(
337 const Error& prev_error, intptr_t token_pos, const char* format, ...)
338 PRINTF_ATTRIBUTE(4, 5);
339 328
340 void CheckRecursiveInvocation(); 329 void CheckRecursiveInvocation();
341 330
342 const Instance& EvaluateConstExpr(intptr_t expr_pos, AstNode* expr); 331 const Instance& EvaluateConstExpr(intptr_t expr_pos, AstNode* expr);
343 AstNode* RunStaticFieldInitializer(const Field& field, 332 AstNode* RunStaticFieldInitializer(const Field& field,
344 intptr_t field_ref_pos); 333 intptr_t field_ref_pos);
345 RawObject* EvaluateConstConstructorCall(const Class& type_class, 334 RawObject* EvaluateConstConstructorCall(const Class& type_class,
346 const TypeArguments& type_arguments, 335 const TypeArguments& type_arguments,
347 const Function& constructor, 336 const Function& constructor,
348 ArgumentListNode* arguments); 337 ArgumentListNode* arguments);
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 intptr_t last_used_try_index_; 721 intptr_t last_used_try_index_;
733 722
734 bool unregister_pending_function_; 723 bool unregister_pending_function_;
735 724
736 DISALLOW_COPY_AND_ASSIGN(Parser); 725 DISALLOW_COPY_AND_ASSIGN(Parser);
737 }; 726 };
738 727
739 } // namespace dart 728 } // namespace dart
740 729
741 #endif // VM_PARSER_H_ 730 #endif // VM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698