File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1002,7 +1002,7 @@ void simplecpp::TokenList::combineOperators()
10021002 continue ;
10031003 }
10041004 // float literals..
1005- if (tok->previous && tok->previous ->number && sameline (tok->previous , tok)) {
1005+ if (tok->previous && tok->previous ->number && sameline (tok->previous , tok) && tok-> previous -> str (). find_first_of ( " ._ " ) == std::string::npos ) {
10061006 tok->setstr (tok->previous ->str () + ' .' );
10071007 deleteToken (tok->previous );
10081008 if (sameline (tok, tok->next ) && (isFloatSuffix (tok->next ) || (tok->next && tok->next ->startsWithOneOf (" AaBbCcDdEeFfPp" )))) {
Original file line number Diff line number Diff line change @@ -390,6 +390,8 @@ static void combineOperators_floatliteral()
390390 ASSERT_EQUALS (" 0x1p+3f" , preprocess (" 0x1p+3f" ));
391391 ASSERT_EQUALS (" 0x1p+3L" , preprocess (" 0x1p+3L" ));
392392 ASSERT_EQUALS (" 1p + 3" , preprocess (" 1p+3" ));
393+ ASSERT_EQUALS (" 1.0_a . b" , preprocess (" 1.0_a.b" ));
394+ ASSERT_EQUALS (" 1_a . b" , preprocess (" 1_a.b" ));
393395}
394396
395397static void combineOperators_increment ()
You can’t perform that action at this time.
0 commit comments