Changeset d55d7a6 for src/Common/SemanticError.cc
- Timestamp:
- Feb 15, 2018, 3:58:56 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 75e3cb2
- Parents:
- d27e340
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.cc
rd27e340 rd55d7a6 23 23 #include "SemanticError.h" 24 24 25 SemanticError::SemanticError() { 26 } 27 28 SemanticError::SemanticError( std::string error ) { 29 append( error ); 25 SemanticError::SemanticError( CodeLocation location, std::string error ) { 26 append( location, error ); 30 27 } 31 28 … … 34 31 } 35 32 36 void SemanticError::append( const std::string & msg ) {37 errors.emplace_back( error_str() +msg );33 void SemanticError::append( CodeLocation location, const std::string & msg ) { 34 errors.emplace_back( location, msg ); 38 35 } 39 36 … … 42 39 } 43 40 44 void SemanticError::print( std::ostream &os) {41 void SemanticError::print() { 45 42 using std::to_string; 46 43 for( auto err : errors ) { 47 os << err.location<< err.description << std::endl;44 std::cerr << bold() << err.location << error_str() << reset_font() << err.description << std::endl; 48 45 } 49 46 } 50 47 51 void SemanticError::set_location( const CodeLocation& location) {52 errors.begin()->maybeSet( location );48 SemanticWarning::SemanticWarning( CodeLocation location, std::string msg ) { 49 std::cerr << bold() << location << warning_str() << reset_font() << msg << std::endl; 53 50 } 54 51
Note: See TracChangeset
for help on using the changeset viewer.