History

updated CK_STDCERR, STK exception printing, casting

gewang committed 4 years ago

Commit 8a9decf1 parent ab23bb417 files · +4867 −2480Browse files

Showing the changes to src/core/chuck_errmsg.cpp (1 of 17 files). Show all

Unified · Split

src/core/chuck_errmsg.cpp+15−11
@@ -43,9 +43,9 @@ · 42 unmodified lines
43#endif43#endif
44 44
45// global45// global
46int EM_tokPos = 0;46t_CKINT EM_tokPos = 0;
47int EM_lineNum = 1;47t_CKINT EM_lineNum = 1;
48int EM_extLineNum = 1;48t_CKINT EM_extLineNum = 1;
49t_CKBOOL anyErrors= FALSE;49t_CKBOOL anyErrors= FALSE;
50 50
51// local global51// local global
@@ -222,10 +222,7 @@ ChuckOutStream::~ChuckOutStream() · 170 unmodified lines
222ChuckOutStream& ChuckOutStream::operator<<( const std::string val )222ChuckOutStream& ChuckOutStream::operator<<( const std::string val )
223{223{
224 m_stream << val;224 m_stream << val;
225 if( val == CK_STDENDL )225 if( m_isErr || (val == CK_STDENDL) ) { this->flush(); }
226 {
227 this->flush();
228 }
229 return *this;226 return *this;
230}227}
231 228
@@ -233,13 +230,15 @@ ChuckOutStream& ChuckOutStream::operator<<( const std::string val ) · 1 unmodified line
233ChuckOutStream& ChuckOutStream::operator<<( const char * val )230ChuckOutStream& ChuckOutStream::operator<<( const char * val )
234{231{
235 m_stream << val;232 m_stream << val;
233 if( m_isErr || std::string(val) == CK_STDENDL ) { this->flush(); }
236 return *this;234 return *this;
237}235}
238 236
239 237
240ChuckOutStream& ChuckOutStream::operator<<( const double val )238ChuckOutStream& ChuckOutStream::operator<<(const double val)
241{239{
242 m_stream << val;240 m_stream << val;
241 if( m_isErr ) { this->flush(); }
243 return *this;242 return *this;
244}243}
245 244
@@ -247,6 +246,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const double val ) · 1 unmodified line
247ChuckOutStream& ChuckOutStream::operator<<( const float val )246ChuckOutStream& ChuckOutStream::operator<<( const float val )
248{247{
249 m_stream << val;248 m_stream << val;
249 if (m_isErr) { this->flush(); }
250 return *this;250 return *this;
251}251}
252 252
@@ -254,6 +254,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const float val ) · 1 unmodified line
254ChuckOutStream& ChuckOutStream::operator<<( const unsigned long long val )254ChuckOutStream& ChuckOutStream::operator<<( const unsigned long long val )
255{255{
256 m_stream << val;256 m_stream << val;
257 if (m_isErr) { this->flush(); }
257 return *this;258 return *this;
258}259}
259 260
@@ -261,6 +262,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned long long val ) · 1 unmodified line
261ChuckOutStream& ChuckOutStream::operator<<( const long long val )262ChuckOutStream& ChuckOutStream::operator<<( const long long val )
262{263{
263 m_stream << val;264 m_stream << val;
265 if (m_isErr) { this->flush(); }
264 return *this;266 return *this;
265}267}
266 268
@@ -268,6 +270,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const long long val ) · 1 unmodified line
268ChuckOutStream& ChuckOutStream::operator<<( const unsigned long val )270ChuckOutStream& ChuckOutStream::operator<<( const unsigned long val )
269{271{
270 m_stream << val;272 m_stream << val;
273 if (m_isErr) { this->flush(); }
271 return *this;274 return *this;
272}275}
273 276
@@ -275,6 +278,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned long val ) · 1 unmodified line
275ChuckOutStream& ChuckOutStream::operator<<( const long val )278ChuckOutStream& ChuckOutStream::operator<<( const long val )
276{279{
277 m_stream << val;280 m_stream << val;
281 if (m_isErr) { this->flush(); }
278 return *this;282 return *this;
279}283}
280 284
@@ -282,6 +286,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const long val ) · 1 unmodified line
282ChuckOutStream& ChuckOutStream::operator<<( const unsigned int val )286ChuckOutStream& ChuckOutStream::operator<<( const unsigned int val )
283{287{
284 m_stream << val;288 m_stream << val;
289 if (m_isErr) { this->flush(); }
285 return *this;290 return *this;
286}291}
287 292
@@ -289,6 +294,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned int val ) · 1 unmodified line
289ChuckOutStream& ChuckOutStream::operator<<( const int val )294ChuckOutStream& ChuckOutStream::operator<<( const int val )
290{295{
291 m_stream << val;296 m_stream << val;
297 if (m_isErr) { this->flush(); }
292 return *this;298 return *this;
293}299}
294 300
@@ -296,13 +302,11 @@ ChuckOutStream& ChuckOutStream::operator<<( const int val ) · 1 unmodified line
296ChuckOutStream& ChuckOutStream::operator<<( const bool val )302ChuckOutStream& ChuckOutStream::operator<<( const bool val )
297{303{
298 m_stream << val;304 m_stream << val;
305 if (m_isErr) { this->flush(); }
299 return *this;306 return *this;
300}307}
301 308
302 309
303
304
305
306void ChuckOutStream::set_callback( void (*callback)( const char * ) )310void ChuckOutStream::set_callback( void (*callback)( const char * ) )
307{311{
308 m_callback = callback;312 m_callback = callback;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t