- Timestamp:
- Apr 19, 2024, 2:36:52 PM (9 months ago)
- Branches:
- master
- Children:
- ba97ebf
- Parents:
- b9b6efb
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Print.cpp
rb9b6efb rfc1a3e2 1579 1579 preprint( node ); 1580 1580 os << "enum attr "; 1581 1582 1583 1584 1585 1586 1587 1581 if ( node->attr == ast::EnumAttribute::Label ) { 1582 os << "Label "; 1583 } else if ( node->attr == ast::EnumAttribute::Value ) { 1584 os << "Value "; 1585 } else { 1586 os << "Posn "; 1587 } 1588 1588 (*(node->instance)).accept( *this ); 1589 1589 return node; -
src/AST/Type.hpp
rb9b6efb rfc1a3e2 31 31 // Must be included in *all* AST classes; should be #undef'd at the end of the file 32 32 #define MUTATE_FRIEND \ 33 33 template<typename node_t> friend node_t * mutate(const node_t * node); \ 34 34 template<typename node_t> friend node_t * shallowCopy(const node_t * node); 35 35 … … 322 322 public: 323 323 readonly<EnumInstType> instance; 324 324 EnumAttribute attr; 325 325 const Type * accept( Visitor & v ) const override { return v.visit( this ); } 326 326 EnumAttrType( const EnumInstType * instance, EnumAttribute attr = EnumAttribute::Posn ) 327 327 : instance(instance), attr(attr) {} 328 329 330 331 328 329 bool match( const ast::EnumAttrType * other) const { 330 return instance->base->name == other->instance->base->name && attr == other->attr; 331 } 332 332 private: 333 333 EnumAttrType * clone() const override { return new EnumAttrType{ *this }; }
Note: See TracChangeset
for help on using the changeset viewer.