Changeset af746cc for src/AST/Type.hpp
- Timestamp:
- Apr 15, 2024, 12:03:53 PM (6 months ago)
- Branches:
- master
- Children:
- dc58e5d
- Parents:
- d9bad51
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Type.hpp
rd9bad51 raf746cc 362 362 using EnumInstType = SueInstType<EnumDecl>; 363 363 364 class Enum PosType final : public Type {364 class EnumAttrType final : public Type { 365 365 public: 366 366 readonly<EnumInstType> instance; 367 const Type * accept( Visitor & v ) const override { return v.visit( this ); } 368 EnumPosType( const EnumInstType * instance ): instance(instance) {} 367 EnumAttribute attr; 368 const Type * accept( Visitor & v ) const override { return v.visit( this ); } 369 EnumAttrType( const EnumInstType * instance, EnumAttribute attr = EnumAttribute::Posn ) 370 : instance(instance), attr(attr) {} 369 371 370 private: 371 EnumPosType * clone() const override { return new EnumPosType{ *this }; } 372 bool match( const ast::EnumAttrType * other) const { 373 return instance->base->name == other->instance->base->name && attr == other->attr; 374 } 375 private: 376 EnumAttrType * clone() const override { return new EnumAttrType{ *this }; } 372 377 MUTATE_FRIEND 373 378 };
Note: See TracChangeset
for help on using the changeset viewer.