- Timestamp:
- Apr 22, 2024, 11:37:36 PM (21 months ago)
- Branches:
- master
- Children:
- 13de4478
- Parents:
- 0fe07be (diff), d7c0ad5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/AST
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.hpp
r0fe07be r15215f02 113 113 static auto read( node_type const * node, Args&&... args ) { 114 114 Pass<core_t> visitor( std::forward<Args>( args )... ); 115 auto const * temp = node->accept( visitor );116 assert( temp == node );117 return visitor.get_result();118 }119 120 // Versions of the above for older compilers.121 template< typename... Args >122 static void run( TranslationUnit & decls ) {123 Pass<core_t> visitor;124 accept_all( decls, visitor );125 }126 127 template< typename node_type, typename... Args >128 static auto read( node_type const * node ) {129 Pass<core_t> visitor;130 115 auto const * temp = node->accept( visitor ); 131 116 assert( temp == node ); -
src/AST/Print.cpp
r0fe07be r15215f02 1579 1579 preprint( node ); 1580 1580 os << "enum attr "; 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 }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
r0fe07be r15215f02 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 template<typename node_t> friend node_t * mutate(const node_t * node); \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 EnumAttribute attr;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 bool match( const ast::EnumAttrType * other) const {330 return instance->base->name == other->instance->base->name && attr == other->attr;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.