Update of /cvsroot/cpptool/rfta/src/rftaparser
In directory sc8-pr-cvs1:/tmp/cvs-serv6947/src/rftaparser
Modified Files:
DeclarationParserTest.cpp DeclarationParserTest.h
NamespaceParser.h
Log Message:
* added handling for anonymous namespace
Index: DeclarationParserTest.cpp
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationParserTest.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DeclarationParserTest.cpp 29 Apr 2003 10:01:25 -0000 1.5
--- DeclarationParserTest.cpp 30 Apr 2003 22:13:59 -0000 1.6
***************
*** 19,23 ****
DeclarationParserTest::DeclarationParserTest()
- : CppUnit::TestFixture()
{
}
--- 19,22 ----
***************
*** 115,118 ****
--- 114,141 ----
endIndex-startIndex );
}
+
+
+ void
+ DeclarationParserTest::testAnonymousNamespace()
+ {
+ const std::string source( " namespace { } " );
+ int startIndex = 2;
+ int endIndex = source.length()-1;
+ SourceASTNodePtr sourceAST = RFTA_ASSERT_PARSER_PASS( DeclarationParser,
+ source,
+ source.length()-1 );
+ ASTNodePtr namespaceDecl = sourceAST->getChildAt(0);
+ RFTA_ASSERT_NODE_HAS( namespaceDecl,
+ ASTNodeTypes::namespaceDeclaration,
+ startIndex,
+ endIndex-startIndex );
+ RFTA_ASSERT_NODE_PROPERTY_HAS(
+ namespaceDecl,
+ ASTNodeProperties::namespaceBodyProperty,
+ ASTNodeTypes::unparsedDeclarationList,
+ 12,
+ 3);
+ }
+
void
Index: DeclarationParserTest.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rftaparser/DeclarationParserTest.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DeclarationParserTest.h 29 Apr 2003 10:01:25 -0000 1.3
--- DeclarationParserTest.h 30 Apr 2003 22:13:59 -0000 1.4
***************
*** 22,25 ****
--- 22,26 ----
CPPUNIT_TEST( testLongUsingNamespace );
CPPUNIT_TEST( testNamespaceAlias );
+ CPPUNIT_TEST( testAnonymousNamespace );
CPPUNIT_TEST( testSimpleLinkage );
CPPUNIT_TEST( testSingleLinkage );
***************
*** 48,51 ****
--- 49,53 ----
void testLongUsingNamespace();
void testNamespaceAlias();
+ void testAnonymousNamespace();
void testSimpleLinkage();
void testSingleLinkage();
Index: NamespaceParser.h
===================================================================
RCS file: /cvsroot/cpptool/rfta/src/rftaparser/NamespaceParser.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NamespaceParser.h 30 Apr 2003 19:20:13 -0000 1.2
--- NamespaceParser.h 30 Apr 2003 22:13:59 -0000 1.3
***************
*** 18,22 ****
{
public:
! /*! Constructs a NamespaceParser object.
*/
NamespaceParser( ParseContext &context,
--- 18,22 ----
{
public:
! /*! Constructs a NamespaceParser object.
*/
NamespaceParser( ParseContext &context,
|