Changeset f238fcc2 for src/SynTree


Ignore:
Timestamp:
Mar 21, 2022, 3:17:37 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
4390fb6
Parents:
3e54399
Message:

Enable numeric type for typed enum

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/BasicType.cc

    r3e54399 rf238fcc2  
    2929}
    3030
     31bool BasicType::isWholeNumber() const {
     32        return kind == Bool ||
     33                kind ==Char ||
     34                kind == SignedChar ||
     35                kind == UnsignedChar ||
     36                kind == ShortSignedInt ||
     37                kind == ShortUnsignedInt ||
     38                kind == SignedInt ||
     39                kind == UnsignedInt ||
     40                kind == LongSignedInt ||
     41                kind == LongUnsignedInt ||
     42                kind == LongLongSignedInt ||
     43                kind ==LongLongUnsignedInt ||
     44                kind == SignedInt128 ||
     45                kind == UnsignedInt128;
     46}
     47
    3148bool BasicType::isInteger() const {
    3249        return kind <= UnsignedInt128;
  • src/SynTree/Type.h

    r3e54399 rf238fcc2  
    268268        virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    269269        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    270 
     270        bool isWholeNumber() const;
    271271        bool isInteger() const;
    272272};
Note: See TracChangeset for help on using the changeset viewer.