Changeset d55d7a6 for src/SynTree


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

Location:
src/SynTree
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rd27e340 rd55d7a6  
    9393                return 0;
    9494        }
    95         throw SemanticError( "Constant expression of non-integral type ", this );
     95        throw SemanticError( this, "Constant expression of non-integral type " );
    9696}
    9797
  • src/SynTree/Mutator.h

    rd27e340 rd55d7a6  
    148148                        } // if
    149149                } catch( SemanticError &e ) {
    150                         e.set_location( (*i)->location );
    151150                        errors.append( e );
    152151                } // try
  • src/SynTree/Statement.cc

    rd27e340 rd55d7a6  
    100100        //actually this is a syntactic error signaled by the parser
    101101        if ( type == BranchStmt::Goto && target.empty() ) {
    102                 throw SemanticError("goto without target");
     102                throw SemanticError( target.get_statement()->location, "goto without target");
    103103        }
    104104}
     
    107107        Statement(), computedTarget( computedTarget ), type( type ) {
    108108        if ( type != BranchStmt::Goto || computedTarget == nullptr ) {
    109                 throw SemanticError("Computed target not valid in branch statement");
     109                throw SemanticError( computedTarget->location, "Computed target not valid in branch statement");
    110110        }
    111111}
     
    203203CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :
    204204        Statement(), condition( condition ), stmts( statements ), _isDefault( deflt ) {
    205         if ( isDefault() && condition != 0 ) throw SemanticError("default case with condition: ", condition);
     205        if ( isDefault() && condition != 0 ) throw SemanticError( condition, "default case with condition: " );
    206206}
    207207
  • src/SynTree/TypeSubstitution.h

    rd27e340 rd55d7a6  
    9898                                } // if
    9999                        } else {
    100                                 throw SemanticError( toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ), formal );
     100                                throw SemanticError( formal, toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ) );
    101101                        } // if
    102102                } else {
  • src/SynTree/Visitor.h

    rd27e340 rd55d7a6  
    142142                        }
    143143                } catch( SemanticError &e ) {
    144                         e.set_location( (*i)->location );
    145144                        errors.append( e );
    146145                }
Note: See TracChangeset for help on using the changeset viewer.