Changes in src/Common/SemanticError.h [fb114fa1:138e29e]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.h
rfb114fa1 r138e29e 23 23 #include <iostream> 24 24 25 #include "utility.h" 26 27 struct error { 28 std::string description; 29 CodeLocation location; 30 31 error() = default; 32 error( const std::string& str ) : description( str ) {} 33 34 void maybeSet( const CodeLocation& location ) { 35 if( this->location.linenumber < 0 ) { 36 this->location = location; 37 } 38 } 39 }; 40 25 41 class SemanticError : public std::exception { 26 42 public: … … 35 51 void print( std::ostream &os ); 36 52 53 void set_location( const CodeLocation& location ); 37 54 // constructs an exception using the given message and the printed 38 55 // representation of the obj (T must have a print method) 39 56 private: 40 std::list< std::string> errors;57 std::list< error > errors; 41 58 }; 42 59
Note: See TracChangeset
for help on using the changeset viewer.