Changeset 525f7ad for src/AST/Expr.hpp


Ignore:
Timestamp:
Jun 19, 2024, 3:20:39 PM (2 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
57e43cd
Parents:
1725989
Message:
  1. Add count_e( enum_name ), a pseudo function that return the number of element in an enum; 2. Implementation of enum range loop.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    r1725989 r525f7ad  
    494494};
    495495
     496class CountExpr final : public Expr {
     497public:
     498        ptr<Type> type;
     499
     500        CountExpr( const CodeLocation & loc, const Type * t );
     501
     502        const Expr * accept( Visitor & v )const override { return v.visit( this ); }
     503private:
     504        CountExpr * clone() const override { return new CountExpr( *this ); }
     505        MUTATE_FRIEND
     506};
     507
    496508/// alignof expression, e.g. `alignof(int)`, `alignof 3+4`
    497509class AlignofExpr final : public Expr {
Note: See TracChangeset for help on using the changeset viewer.