OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 RUNTIME_VM_REPORT_H_ | 5 #ifndef RUNTIME_VM_REPORT_H_ |
6 #define RUNTIME_VM_REPORT_H_ | 6 #define RUNTIME_VM_REPORT_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/token_position.h" | 9 #include "vm/token_position.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 }; | 29 }; |
30 | 30 |
31 static const bool AtLocation = false; | 31 static const bool AtLocation = false; |
32 static const bool AfterLocation = true; | 32 static const bool AfterLocation = true; |
33 | 33 |
34 // Report an already formatted error via a long jump. | 34 // Report an already formatted error via a long jump. |
35 static void LongJump(const Error& error); | 35 static void LongJump(const Error& error); |
36 | 36 |
37 // Concatenate and report an already formatted error and a new error message. | 37 // Concatenate and report an already formatted error and a new error message. |
38 static void LongJumpF(const Error& prev_error, | 38 static void LongJumpF(const Error& prev_error, |
39 const Script& script, TokenPosition token_pos, | 39 const Script& script, |
40 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); | 40 TokenPosition token_pos, |
| 41 const char* format, |
| 42 ...) PRINTF_ATTRIBUTE(4, 5); |
41 static void LongJumpV(const Error& prev_error, | 43 static void LongJumpV(const Error& prev_error, |
42 const Script& script, TokenPosition token_pos, | 44 const Script& script, |
43 const char* format, va_list args); | 45 TokenPosition token_pos, |
| 46 const char* format, |
| 47 va_list args); |
44 | 48 |
45 // Report a warning/jswarning/error/bailout message. | 49 // Report a warning/jswarning/error/bailout message. |
46 static void MessageF(Kind kind, | 50 static void MessageF(Kind kind, |
47 const Script& script, | 51 const Script& script, |
48 TokenPosition token_pos, | 52 TokenPosition token_pos, |
49 bool report_after_token, | 53 bool report_after_token, |
50 const char* format, ...) PRINTF_ATTRIBUTE(5, 6); | 54 const char* format, |
| 55 ...) PRINTF_ATTRIBUTE(5, 6); |
51 static void MessageV(Kind kind, | 56 static void MessageV(Kind kind, |
52 const Script& script, | 57 const Script& script, |
53 TokenPosition token_pos, | 58 TokenPosition token_pos, |
54 bool report_after_token, | 59 bool report_after_token, |
55 const char* format, va_list args); | 60 const char* format, |
| 61 va_list args); |
56 | 62 |
57 // Prepend a source snippet to the message. | 63 // Prepend a source snippet to the message. |
58 // A null script means no source and a negative token_pos means no position. | 64 // A null script means no source and a negative token_pos means no position. |
59 static RawString* PrependSnippet(Kind kind, | 65 static RawString* PrependSnippet(Kind kind, |
60 const Script& script, | 66 const Script& script, |
61 TokenPosition token_pos, | 67 TokenPosition token_pos, |
62 bool report_after_token, | 68 bool report_after_token, |
63 const String& message); | 69 const String& message); |
64 | 70 |
65 private: | 71 private: |
66 DISALLOW_COPY_AND_ASSIGN(Report); | 72 DISALLOW_COPY_AND_ASSIGN(Report); |
67 }; | 73 }; |
68 | 74 |
69 } // namespace dart | 75 } // namespace dart |
70 | 76 |
71 #endif // RUNTIME_VM_REPORT_H_ | 77 #endif // RUNTIME_VM_REPORT_H_ |
72 | |
OLD | NEW |