Index: runtime/vm/report.cc |
diff --git a/runtime/vm/report.cc b/runtime/vm/report.cc |
index b53c4942afd5b25b6605107d76d1349b9b74edf0..ba87b5ee260fb611ab946da5270240cda9eee658 100644 |
--- a/runtime/vm/report.cc |
+++ b/runtime/vm/report.cc |
@@ -24,12 +24,24 @@ RawString* Report::PrependSnippet(Kind kind, |
const String& message) { |
const char* message_header; |
switch (kind) { |
- case kWarning: message_header = "warning"; break; |
- case kError: message_header = "error"; break; |
- case kMalformedType: message_header = "malformed type"; break; |
- case kMalboundedType: message_header = "malbounded type"; break; |
- case kBailout: message_header = "bailout"; break; |
- default: message_header = ""; UNREACHABLE(); |
+ case kWarning: |
+ message_header = "warning"; |
+ break; |
+ case kError: |
+ message_header = "error"; |
+ break; |
+ case kMalformedType: |
+ message_header = "malformed type"; |
+ break; |
+ case kMalboundedType: |
+ message_header = "malbounded type"; |
+ break; |
+ case kBailout: |
+ message_header = "bailout"; |
+ break; |
+ default: |
+ message_header = ""; |
+ UNREACHABLE(); |
} |
String& result = String::Handle(); |
if (!script.IsNull()) { |
@@ -47,42 +59,34 @@ RawString* Report::PrependSnippet(Kind kind, |
// optimizing compilation. Those strings are created rarely and should not |
// polute old space. |
if (script.HasSource()) { |
- result = String::NewFormatted(Heap::kOld, |
- "'%s': %s: line %" Pd " pos %" Pd ": ", |
- script_url.ToCString(), |
- message_header, |
- line, |
- column); |
+ result = String::NewFormatted( |
+ Heap::kOld, "'%s': %s: line %" Pd " pos %" Pd ": ", |
+ script_url.ToCString(), message_header, line, column); |
} else { |
- result = String::NewFormatted(Heap::kOld, |
- "'%s': %s: line %" Pd ": ", |
- script_url.ToCString(), |
- message_header, |
- line); |
+ result = |
+ String::NewFormatted(Heap::kOld, "'%s': %s: line %" Pd ": ", |
+ script_url.ToCString(), message_header, line); |
} |
// Append the formatted error or warning message. |
- const Array& strs = Array::Handle( |
- Array::New(6, Heap::kOld)); |
+ const Array& strs = Array::Handle(Array::New(6, Heap::kOld)); |
strs.SetAt(0, result); |
strs.SetAt(1, message); |
// Append the source line. |
- const String& script_line = String::Handle( |
- script.GetLine(line, Heap::kOld)); |
+ const String& script_line = |
+ String::Handle(script.GetLine(line, Heap::kOld)); |
ASSERT(!script_line.IsNull()); |
strs.SetAt(2, Symbols::NewLine()); |
strs.SetAt(3, script_line); |
strs.SetAt(4, Symbols::NewLine()); |
// Append the column marker. |
- const String& column_line = String::Handle( |
- String::NewFormatted(Heap::kOld, |
- "%*s\n", static_cast<int>(column), "^")); |
+ const String& column_line = String::Handle(String::NewFormatted( |
+ Heap::kOld, "%*s\n", static_cast<int>(column), "^")); |
strs.SetAt(5, column_line); |
result = String::ConcatAll(strs, Heap::kOld); |
} else { |
// Token position is unknown. |
result = String::NewFormatted(Heap::kOld, "'%s': %s: ", |
- script_url.ToCString(), |
- message_header); |
+ script_url.ToCString(), message_header); |
result = String::Concat(result, message, Heap::kOld); |
} |
} else { |
@@ -102,8 +106,10 @@ void Report::LongJump(const Error& error) { |
void Report::LongJumpF(const Error& prev_error, |
- const Script& script, TokenPosition token_pos, |
- const char* format, ...) { |
+ const Script& script, |
+ TokenPosition token_pos, |
+ const char* format, |
+ ...) { |
va_list args; |
va_start(args, format); |
LongJumpV(prev_error, script, token_pos, format, args); |
@@ -113,11 +119,12 @@ void Report::LongJumpF(const Error& prev_error, |
void Report::LongJumpV(const Error& prev_error, |
- const Script& script, TokenPosition token_pos, |
- const char* format, va_list args) { |
+ const Script& script, |
+ TokenPosition token_pos, |
+ const char* format, |
+ va_list args) { |
const Error& error = Error::Handle(LanguageError::NewFormattedV( |
- prev_error, script, token_pos, Report::AtLocation, |
- kError, Heap::kOld, |
+ prev_error, script, token_pos, Report::AtLocation, kError, Heap::kOld, |
format, args)); |
LongJump(error); |
UNREACHABLE(); |
@@ -128,7 +135,8 @@ void Report::MessageF(Kind kind, |
const Script& script, |
TokenPosition token_pos, |
bool report_after_token, |
- const char* format, ...) { |
+ const char* format, |
+ ...) { |
va_list args; |
va_start(args, format); |
MessageV(kind, script, token_pos, report_after_token, format, args); |
@@ -140,7 +148,8 @@ void Report::MessageV(Kind kind, |
const Script& script, |
TokenPosition token_pos, |
bool report_after_token, |
- const char* format, va_list args) { |
+ const char* format, |
+ va_list args) { |
if (kind < kError) { |
// Reporting a warning. |
if (FLAG_silent_warnings) { |
@@ -155,14 +164,11 @@ void Report::MessageV(Kind kind, |
} |
} |
// Reporting an error (or a warning as error). |
- const Error& error = Error::Handle( |
- LanguageError::NewFormattedV(Error::Handle(), // No previous error. |
- script, token_pos, report_after_token, |
- kind, Heap::kOld, |
- format, args)); |
+ const Error& error = Error::Handle(LanguageError::NewFormattedV( |
+ Error::Handle(), // No previous error. |
+ script, token_pos, report_after_token, kind, Heap::kOld, format, args)); |
LongJump(error); |
UNREACHABLE(); |
} |
} // namespace dart |
- |