Ignore:
Timestamp:
Dec 14, 2023, 9:05:55 PM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
19a2890
Parents:
21ad568
Message:

second attempt at simplifying SemanticError? messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r21ad568 rca9d65e  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 17 14:41:48 2023
    13 // Update Count     : 1405
     12// Last Modified On : Thu Dec 14 19:05:17 2023
     13// Update Count     : 1407
    1414//
    1515
     
    632632                                        dst->basictype = src->basictype;
    633633                                } else if ( src->basictype != DeclarationNode::NoBasicType )
    634                                         SemanticError( yylloc, string( "multiple declaration types \"" ) + DeclarationNode::basicTypeNames[ dst->basictype ] +
    635                                                                    "\" and \"" + DeclarationNode::basicTypeNames[ src->basictype ] + "\"." );
    636 
     634                                        SemanticError( yylloc, "multiple declaration types \"%s\" and \"%s\".",
     635                                                                   DeclarationNode::basicTypeNames[ dst->basictype ],
     636                                                                   DeclarationNode::basicTypeNames[ src->basictype ] );
    637637                                if ( dst->complextype == DeclarationNode::NoComplexType ) {
    638638                                        dst->complextype = src->complextype;
    639639                                } else if ( src->complextype != DeclarationNode::NoComplexType )
    640                                         SemanticError( yylloc, string( "multiple declaration types \"" ) + DeclarationNode::complexTypeNames[ src->complextype ] +
    641                                                                    "\" and \"" + DeclarationNode::complexTypeNames[ src->complextype ] + "\"." );
    642 
     640                                        SemanticError( yylloc, "multiple declaration types \"%s\" and \"%s\".",
     641                                                                   DeclarationNode::complexTypeNames[ src->complextype ],
     642                                                                   DeclarationNode::complexTypeNames[ src->complextype ] );
    643643                                if ( dst->signedness == DeclarationNode::NoSignedness ) {
    644644                                        dst->signedness = src->signedness;
    645645                                } else if ( src->signedness != DeclarationNode::NoSignedness )
    646                                         SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::signednessNames[ dst->signedness ] +
    647                                                                    "\" and \"" + DeclarationNode::signednessNames[ src->signedness ] + "\"." );
    648 
     646                                        SemanticError( yylloc, "conflicting type specifier \"%s\" and \"%s\".",
     647                                                                   DeclarationNode::signednessNames[ dst->signedness ],
     648                                                                   DeclarationNode::signednessNames[ src->signedness ] );
    649649                                if ( dst->length == DeclarationNode::NoLength ) {
    650650                                        dst->length = src->length;
     
    652652                                        dst->length = DeclarationNode::LongLong;
    653653                                } else if ( src->length != DeclarationNode::NoLength )
    654                                         SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::lengthNames[ dst->length ] +
    655                                                                    "\" and \"" + DeclarationNode::lengthNames[ src->length ] + "\"." );
     654                                        SemanticError( yylloc, "conflicting type specifier \"%s\" and \"%s\".",
     655                                                                   DeclarationNode::lengthNames[ dst->length ],
     656                                                                   DeclarationNode::lengthNames[ src->length ] );
    656657                        } // if
    657658                        break;
Note: See TracChangeset for help on using the changeset viewer.