Ignore:
Timestamp:
Dec 1, 2016, 12:46:34 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
78b3f52
Parents:
148f7290
Message:

0 and 1 now properly parse and resolve to zero_t and one_t respectively

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ExpressionNode.cc

    r148f7290 r4cb935e  
    4646// type.
    4747
    48 static Type::Qualifiers emptyQualifiers;                                // no qualifiers on constants
     48Type::Qualifiers emptyQualifiers;                               // no qualifiers on constants
    4949
    5050static inline bool checkU( char c ) { return c == 'u' || c == 'U'; }
     
    172172} // build_constantStr
    173173
     174Expression *build_constantZeroOne( const std::string & str ) {
     175        Expression * ret = new ConstantExpr( Constant( str == "0" ? (Type*)new ZeroType( emptyQualifiers ) : (Type*)new OneType( emptyQualifiers ), str ) );
     176        delete &str;                                                                            // created by lex
     177        return ret;
     178} // build_constantChar
     179
    174180Expression * build_field_name_FLOATINGconstant( const std::string & str ) {
    175181        // str is of the form A.B -> separate at the . and return member expression
Note: See TracChangeset for help on using the changeset viewer.