Changeset 0213af6
- Timestamp:
- May 17, 2017, 10:58:32 PM (8 years ago)
- 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:
- 0642216
- Parents:
- 7e17503
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
r7e17503 r0213af6 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 30 17:02:46201713 // Update Count : 5 1512 // Last Modified On : Wed May 17 21:31:01 2017 13 // Update Count : 527 14 14 // 15 15 … … 207 207 } // build_field_name_fraction_constants 208 208 209 210 209 211 Expression * build_field_name_REALFRACTIONconstant( const std::string & str ) { 210 assert( str[0] == '.');212 if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) throw SemanticError( "invalid tuple index " + str ); 211 213 Expression * ret = build_constantInteger( *new std::string( str.substr(1) ) ); 212 214 delete &str; … … 215 217 216 218 Expression * build_field_name_REALDECIMALconstant( const std::string & str ) { 217 assert( str[str.size()-1] == '.');219 if ( str[str.size()-1] != '.' ) throw SemanticError( "invalid tuple index " + str ); 218 220 Expression * ret = build_constantInteger( *new std::string( str.substr( 0, str.size()-1 ) ) ); 219 221 delete &str; -
src/Parser/lex.ll
r7e17503 r0213af6 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Mon Mar 13 08:36:17201713 * Update Count : 5 0612 * Last Modified On : Wed May 17 21:37:51 2017 13 * Update Count : 510 14 14 */ 15 15 … … 77 77 // numeric constants, CFA: '_' in constant 78 78 hex_quad {hex}("_"?{hex}){3} 79 integer_suffix "_"?(([uU][lL]? )|([uU]("ll"|"LL")?)|([lL][uU]?)|("ll"|"LL")[uU]?)79 integer_suffix "_"?(([uU][lL]?[lL]?[iI]?)|([uU][iI]?[lL]?[lL]?)|([lL][lL]?[uU]?[iI]?)|([iI][lL]?[lL]?[uU]?)) 80 80 81 81 octal_digits ({octal})|({octal}({octal}|"_")*{octal}) … … 91 91 92 92 decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal}) 93 real_decimal {decimal_digits}"." 94 real_fraction "."{decimal_digits} 95 real_constant {decimal_digits} ?{real_fraction}93 real_decimal {decimal_digits}"."{exponent}?{floating_suffix}? 94 real_fraction "."{decimal_digits}{exponent}?{floating_suffix}? 95 real_constant {decimal_digits}{real_fraction} 96 96 exponent "_"?[eE]"_"?[+-]?{decimal_digits} 97 97 // GCC: D (double), DL (long double) and iI (imaginary) suffixes
Note: See TracChangeset
for help on using the changeset viewer.