From: <bl...@us...> - 2003-05-03 18:06:40
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv9891/src/rftaparser Modified Files: DeclarationDetailsParser.cpp UnparsedDeclarationMutatorTest.cpp UnparsedDeclarationMutatorTest.h Log Message: * bug fix: parsing error if there was a space between '~' and the destructor name. Index: DeclarationDetailsParser.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationDetailsParser.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DeclarationDetailsParser.cpp 3 May 2003 17:41:38 -0000 1.5 --- DeclarationDetailsParser.cpp 3 May 2003 18:06:37 -0000 1.6 *************** *** 584,587 **** --- 584,588 ---- if ( tryNextIs( '~' ) ) { // handle destructor (buggy, need to ensure not followed by const or volatile) + skipSpaces(); } Index: UnparsedDeclarationMutatorTest.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/UnparsedDeclarationMutatorTest.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** UnparsedDeclarationMutatorTest.cpp 3 May 2003 17:43:12 -0000 1.9 --- UnparsedDeclarationMutatorTest.cpp 3 May 2003 18:06:37 -0000 1.10 *************** *** 728,731 **** --- 728,749 ---- void + UnparsedDeclarationMutatorTest::testVirtualDestructorMemberWithSpace() + { + Testing::KeyedString source; + source.addKeyed(SPECIFIER , "virtual" ) << " "; + source.addKeyed(DECLARATOR, "~ Destructor()" ) << ";"; + + SourceASTNodePtr sourceAST = RFTA_ASSERT_DECLARATION_MUTATOR_PASS( source ); + ASTNodePtr node = sourceAST->getChildAt(0); + + // check AST: + RFTA_ASSERT_DECLARATION( source, sourceAST ); + + // check declarator types: + RFTA_ASSERT_NODE_TYPE( node->getChildAt(0), ASTNodeTypes::unparsedDeclarator); + } + + + void UnparsedDeclarationMutatorTest::testMemberPure() { Index: UnparsedDeclarationMutatorTest.h =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/UnparsedDeclarationMutatorTest.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UnparsedDeclarationMutatorTest.h 3 May 2003 17:43:13 -0000 1.6 --- UnparsedDeclarationMutatorTest.h 3 May 2003 18:06:37 -0000 1.7 *************** *** 48,51 **** --- 48,52 ---- CPPUNIT_TEST( testDestructorMember ); CPPUNIT_TEST( testVirtualDestructorMember ); + CPPUNIT_TEST( testVirtualDestructorMemberWithSpace ); CPPUNIT_TEST( testMemberPure ); CPPUNIT_TEST( testMemberConstInit ); *************** *** 92,95 **** --- 93,97 ---- void testDestructorMember(); void testVirtualDestructorMember(); + void testVirtualDestructorMemberWithSpace(); void testMemberPure(); void testMemberConstInit(); |