Changes in src/Parser/ExpressionNode.cc [dc7db63:0a2168f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
rdc7db63 r0a2168f 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 22 11:57:39201813 // Update Count : 80112 // Last Modified On : Sat Mar 3 18:22:33 2018 13 // Update Count : 796 14 14 // 15 15 … … 94 94 } // checkLNInt 95 95 96 static void sepNumeric( string & str, string & units ) { 97 string::size_type posn = str.find_first_of( "`" ); 98 if ( posn != string::npos ) { 99 units = "?" + str.substr( posn ); // extract units 100 str.erase( posn ); // remove units 101 } // if 102 } // sepNumeric 103 96 104 Expression * build_constantInteger( string & str ) { 97 105 static const BasicType::Kind kind[2][6] = { … … 100 108 { BasicType::ShortUnsignedInt, BasicType::UnsignedChar, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::UnsignedInt128, }, 101 109 }; 110 111 string units; 112 sepNumeric( str, units ); // separate constant from units 102 113 103 114 bool dec = true, Unsigned = false; // decimal, unsigned constant … … 221 232 } // if 222 233 CLEANUP: 234 if ( units.length() != 0 ) { 235 ret = new UntypedExpr( new NameExpr( units ), { ret } ); 236 } // if 223 237 224 238 delete &str; // created by lex … … 254 268 }; 255 269 270 string units; 271 sepNumeric( str, units ); // separate constant from units 272 256 273 bool complx = false; // real, complex 257 274 int size = 1; // 0 => float, 1 => double, 2 => long double … … 286 303 if ( lnth != -1 ) { // explicit length ? 287 304 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ) ); 305 } // if 306 if ( units.length() != 0 ) { 307 ret = new UntypedExpr( new NameExpr( units ), { ret } ); 288 308 } // if 289 309
Note:
See TracChangeset
for help on using the changeset viewer.