Ignore:
Timestamp:
Feb 14, 2017, 3:53:52 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
9bb90a86
Parents:
294647b
Message:

Implemented filename and linenumber errors in most cases, only missing constructor errors apparently

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    r294647b r138e29e  
    2525#include "utility.h"
    2626
     27struct 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
    2741class SemanticError : public std::exception {
    2842  public:
     
    4155        // representation of the obj (T must have a print method)
    4256  private:
    43         std::list< std::string > errors;
    44         CodeLocation location;
     57        std::list< error > errors;
    4558};
    4659
Note: See TracChangeset for help on using the changeset viewer.