Changes in src/Common/SemanticError.cc [d55d7a6:80ac42d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.cc
rd55d7a6 r80ac42d 23 23 #include "SemanticError.h" 24 24 25 SemanticError::SemanticError( CodeLocation location, std::string error ) { 26 append( location, error ); 25 SemanticError::SemanticError() { 26 } 27 28 SemanticError::SemanticError( std::string error ) { 29 append( error ); 27 30 } 28 31 … … 31 34 } 32 35 33 void SemanticError::append( CodeLocation location,const std::string & msg ) {34 errors.emplace_back( location,msg );36 void SemanticError::append( const std::string & msg ) { 37 errors.emplace_back( error_str() + msg ); 35 38 } 36 39 … … 39 42 } 40 43 41 void SemanticError::print( ) {44 void SemanticError::print( std::ostream &os ) { 42 45 using std::to_string; 43 46 for( auto err : errors ) { 44 std::cerr << bold() << err.location << error_str() << reset_font()<< err.description << std::endl;47 os << err.location << err.description << std::endl; 45 48 } 46 49 } 47 50 48 SemanticWarning::SemanticWarning( CodeLocation location, std::string msg) {49 std::cerr << bold() << location << warning_str() << reset_font() << msg << std::endl;51 void SemanticError::set_location( const CodeLocation& location ) { 52 errors.begin()->maybeSet( location ); 50 53 } 51 54
Note:
See TracChangeset
for help on using the changeset viewer.