| 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 #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 Loading... |
| 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 an already formatted error and a new error message. |
| 322 void ErrorMsg(const char* msg, ...) PRINTF_ATTRIBUTE(2, 3); | 318 static void ReportErrors(const Error& prev_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, |
| 327 const char* msg, ...) const PRINTF_ATTRIBUTE(3, 4); |
| 334 | 328 |
| 335 // Concatenates two error messages, the previous and the current one. | 329 // Report warning message at location of current token in current script. |
| 336 void AppendErrorMsg( | 330 void ReportWarning(const char* msg, ...) const PRINTF_ATTRIBUTE(2, 3); |
| 337 const Error& prev_error, intptr_t token_pos, const char* format, ...) | 331 |
| 338 PRINTF_ATTRIBUTE(4, 5); | 332 // Report warning message at given location in current script. |
| 333 void ReportWarning(intptr_t token_pos, |
| 334 const char* msg, ...) const PRINTF_ATTRIBUTE(3, 4); |
| 339 | 335 |
| 340 void CheckRecursiveInvocation(); | 336 void CheckRecursiveInvocation(); |
| 341 | 337 |
| 342 const Instance& EvaluateConstExpr(intptr_t expr_pos, AstNode* expr); | 338 const Instance& EvaluateConstExpr(intptr_t expr_pos, AstNode* expr); |
| 343 AstNode* RunStaticFieldInitializer(const Field& field, | 339 AstNode* RunStaticFieldInitializer(const Field& field, |
| 344 intptr_t field_ref_pos); | 340 intptr_t field_ref_pos); |
| 345 RawObject* EvaluateConstConstructorCall(const Class& type_class, | 341 RawObject* EvaluateConstConstructorCall(const Class& type_class, |
| 346 const TypeArguments& type_arguments, | 342 const TypeArguments& type_arguments, |
| 347 const Function& constructor, | 343 const Function& constructor, |
| 348 ArgumentListNode* arguments); | 344 ArgumentListNode* arguments); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 intptr_t last_used_try_index_; | 728 intptr_t last_used_try_index_; |
| 733 | 729 |
| 734 bool unregister_pending_function_; | 730 bool unregister_pending_function_; |
| 735 | 731 |
| 736 DISALLOW_COPY_AND_ASSIGN(Parser); | 732 DISALLOW_COPY_AND_ASSIGN(Parser); |
| 737 }; | 733 }; |
| 738 | 734 |
| 739 } // namespace dart | 735 } // namespace dart |
| 740 | 736 |
| 741 #endif // VM_PARSER_H_ | 737 #endif // VM_PARSER_H_ |
| OLD | NEW |