Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rf196351 re6cee92  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug 10 17:02:00 2017
    13 // Update Count     : 1021
     12// Last Modified On : Wed Jun 28 15:27:00 2017
     13// Update Count     : 1019
    1414//
    1515
     
    253253        newnode->type->aggregate.fields = fields;
    254254        newnode->type->aggregate.body = body;
    255         newnode->type->aggregate.tagged = false;
    256         newnode->type->aggregate.parent = nullptr;
    257255        return newnode;
    258256} // DeclarationNode::newAggregate
     
    331329} // DeclarationNode::newTypeDecl
    332330
    333 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) {
    334         DeclarationNode * newnode = new DeclarationNode;
    335         newnode->type = new TypeData( TypeData::Pointer );
     331DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers, OperKinds kind ) {
     332        DeclarationNode * newnode = new DeclarationNode;
     333        newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference );
    336334        if ( qualifiers ) {
    337335                return newnode->addQualifiers( qualifiers );
     
    750748DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) {
    751749        if ( p ) {
    752                 assert( p->type->kind == TypeData::Pointer );
     750                assert( p->type->kind == TypeData::Pointer || TypeData::Reference );
    753751                setBase( p->type );
    754752                p->type = nullptr;
     
    772770DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode * p ) {
    773771        if ( p ) {
    774                 assert( p->type->kind == TypeData::Pointer );
     772                assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference );
    775773                if ( type ) {
    776774                        switch ( type->kind ) {
Note: See TracChangeset for help on using the changeset viewer.