Changeset 90e683b for src/AST/Util.cpp


Ignore:
Timestamp:
Feb 3, 2025, 11:46:55 AM (2 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
54f70c6
Parents:
bbbff10
Message:

I set out to do a enum rework. It ended up being much the same and I unwound the core rework. But I hope the new names are a bit clearer and other minor fixes are helpful, so I am keeping those.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/AST/Util.cpp

    rbbbff10 r90e683b  
    8585        // Check that `type->returns` corresponds with `decl->returns`.
    8686        assert( type->returns.size() == decl->returns.size() );
     87}
     88
     89/// Check that an enumeration has not been made with an inconsistent spec.
     90void isEnumerationConsistent( const EnumDecl * node ) {
     91        if ( node->is_c_enum() ) {
     92                assert( nullptr == node->base );
     93        }
    8794}
    8895
     
    135142                previsit( (const ParseNode *)node );
    136143                functionDeclMatchesType( node );
     144        }
     145
     146        void previsit( const EnumDecl * node ) {
     147                previsit( (const ParseNode *)node );
     148                isEnumerationConsistent( node );
    137149        }
    138150
Note: See TracChangeset for help on using the changeset viewer.