Ignore:
Timestamp:
Jan 7, 2015, 6:04:42 PM (10 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
0b8cd722
Parents:
d9a0e76
Message:

fixed restrict, fixed parameter copy, introduced name table for types, changed variable after to string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/Parser/TypeData.cc

    rd9a0e76 r17cd4eb  
    560560            if ( *i == DeclarationNode::Void ) {
    561561                if ( basic->typeSpec.size() != 1 || !basic->modifiers.empty() ) {
    562                     throw SemanticError( "invalid type specifier \"void\" in type ", this );
     562                    throw SemanticError( "invalid type specifier \"void\" in type: ", this );
    563563                } else {
    564564                    return new VoidType( buildQualifiers() );
     
    571571              case DeclarationNode::Float:
    572572                if ( sawDouble ) {
    573                     throw SemanticError( "invalid type specifier \"float\" in type ", this );
     573                    throw SemanticError( "invalid type specifier \"float\" in type: ", this );
    574574                } else {
    575575                    switch ( ret ) {
     
    581581                        break;
    582582                      default:
    583                         throw SemanticError( "invalid type specifier \"float\" in type ", this );
     583                        throw SemanticError( "invalid type specifier \"float\" in type: ", this );
    584584                    }
    585585                }
     
    587587              case DeclarationNode::Double:
    588588                if ( sawDouble ) {
    589                     throw SemanticError( "duplicate type specifier \"double\" in type ", this );
     589                    throw SemanticError( "duplicate type specifier \"double\" in type: ", this );
    590590                } else {
    591591                    switch ( ret ) {
     
    594594                        break;
    595595                      default:
    596                         throw SemanticError( "invalid type specifier \"double\" in type ", this );
     596                        throw SemanticError( "invalid type specifier \"double\" in type: ", this );
    597597                    }
    598598                }
     
    609609                    break;
    610610                  default:
    611                     throw SemanticError( "invalid type specifier \"complex\" in type ", this );
     611                    throw SemanticError( "invalid type specifier \"_Complex\" in type: ", this );
    612612                }
    613613                break;
     
    623623                    break;
    624624                  default:
    625                     throw SemanticError( "invalid type specifier \"imaginary\" in type ", this );
     625                    throw SemanticError( "invalid type specifier \"_Imaginary\" in type: ", this );
    626626                }
    627627                break;
    628628       
    629629              default:
    630                 throw SemanticError( std::string( "invalid type specifier \"" ) + DeclarationNode::basicTypeName[ *i ] + "\" in type ", this );
     630                throw SemanticError( std::string( "invalid type specifier \"" ) + DeclarationNode::basicTypeName[ *i ] + "\" in type: ", this );
    631631            }
    632632        }
     
    666666                    break;
    667667                  default:
    668                     throw SemanticError( "invalid type modifier \"long\" in type ", this );
     668                    throw SemanticError( "invalid type modifier \"long\" in type: ", this );
    669669                }
    670670            }
     
    683683                    break;
    684684                  default:
    685                     throw SemanticError( "invalid type modifier \"short\" in type ", this );
     685                    throw SemanticError( "invalid type modifier \"short\" in type: ", this );
    686686                }
    687687            }
     
    692692                ret = BasicType::SignedInt;
    693693            } else if ( sawSigned ) {
    694                 throw SemanticError( "duplicate type modifer \"signed\" in type ", this );
     694                throw SemanticError( "duplicate type modifer \"signed\" in type: ", this );
    695695            } else {
    696696                switch ( ret ) {
     
    702702                    break;
    703703                  default:
    704                     throw SemanticError( "invalid type modifer \"signed\" in type ", this );
     704                    throw SemanticError( "invalid type modifer \"signed\" in type: ", this );
    705705                }
    706706            }
     
    711711                ret = BasicType::UnsignedInt;
    712712            } else if ( sawSigned ) {
    713                 throw SemanticError( "invalid type modifer \"unsigned\" in type ", this );
     713                throw SemanticError( "invalid type modifer \"unsigned\" in type: ", this );
    714714            } else {
    715715                switch ( ret ) {
     
    727727                    break;
    728728                  default:
    729                     throw SemanticError( "invalid type modifer \"unsigned\" in type ", this );
     729                    throw SemanticError( "invalid type modifer \"unsigned\" in type: ", this );
    730730                }
    731731            }
Note: See TracChangeset for help on using the changeset viewer.