Ignore:
Timestamp:
Feb 15, 2018, 3:58:56 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:
75e3cb2
Parents:
d27e340
Message:

Massive change to errors to enable warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.cc

    rd27e340 rd55d7a6  
    2323#include "SemanticError.h"
    2424
    25 SemanticError::SemanticError() {
    26 }
    27 
    28 SemanticError::SemanticError( std::string error ) {
    29         append( error );
     25SemanticError::SemanticError( CodeLocation location, std::string error ) {
     26        append( location, error );
    3027}
    3128
     
    3431}
    3532
    36 void SemanticError::append( const std::string & msg ) {
    37         errors.emplace_back( error_str() + msg );
     33void SemanticError::append( CodeLocation location, const std::string & msg ) {
     34        errors.emplace_back( location, msg );
    3835}
    3936
     
    4239}
    4340
    44 void SemanticError::print( std::ostream &os ) {
     41void SemanticError::print() {
    4542        using std::to_string;
    4643        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;
    4845        }
    4946}
    5047
    51 void SemanticError::set_location( const CodeLocation& location ) {
    52         errors.begin()->maybeSet( location );
     48SemanticWarning::SemanticWarning( CodeLocation location, std::string msg ) {
     49        std::cerr << bold() << location << warning_str() << reset_font() << msg << std::endl;
    5350}
    5451
Note: See TracChangeset for help on using the changeset viewer.