Ignore:
Timestamp:
Feb 22, 2017, 2:42:11 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
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:
131dbb3, 692de479
Parents:
0788b739 (diff), fc39193 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    r0788b739 r396ee0a  
    2323#include <iostream>
    2424
     25#include "utility.h"
     26
     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
    2541class SemanticError : public std::exception {
    2642  public:
     
    3551        void print( std::ostream &os );
    3652
     53        void set_location( const CodeLocation& location );
    3754        // constructs an exception using the given message and the printed
    3855        // representation of the obj (T must have a print method)
    3956  private:
    40         std::list< std::string > errors;
     57        std::list< error > errors;
    4158};
    4259
Note: See TracChangeset for help on using the changeset viewer.