Changes in src/SynTree/Statement.cc [44b4114:d55d7a6]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.cc
r44b4114 rd55d7a6 100 100 //actually this is a syntactic error signaled by the parser 101 101 if ( type == BranchStmt::Goto && target.empty() ) { 102 throw SemanticError( "goto without target");102 throw SemanticError( target.get_statement()->location, "goto without target"); 103 103 } 104 104 } … … 107 107 Statement(), computedTarget( computedTarget ), type( type ) { 108 108 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"); 110 110 } 111 111 } … … 203 203 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) : 204 204 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: " ); 206 206 } 207 207 … … 468 468 void WithStmt::print( std::ostream & os, Indenter indent ) const { 469 469 os << "With statement" << endl; 470 os << indent << "... with expressions: " << endl;471 printAll( exprs, os, indent+1 );472 470 os << indent << "... with statement:" << endl << indent+1; 473 471 stmt->print( os, indent+1 );
Note:
See TracChangeset
for help on using the changeset viewer.