[pygccxml-commit] SF.net SVN: pygccxml: [548] pygccxml_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-09-18 08:18:18
|
Revision: 548 http://svn.sourceforge.net/pygccxml/?rev=548&view=rev Author: roman_yakovenko Date: 2006-09-18 01:18:09 -0700 (Mon, 18 Sep 2006) Log Message: ----------- improving pattern_parser.py Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/pattern_parser.py pygccxml_dev/unittests/call_invocation_tester.py Modified: pygccxml_dev/pygccxml/declarations/pattern_parser.py =================================================================== --- pygccxml_dev/pygccxml/declarations/pattern_parser.py 2006-09-17 08:46:42 UTC (rev 547) +++ pygccxml_dev/pygccxml/declarations/pattern_parser.py 2006-09-18 08:18:09 UTC (rev 548) @@ -66,8 +66,9 @@ if -1 == found: args.append( args_only[ previous_found : ] ) break - elif decl_string[ found ] == self.__end: - raise RuntimeError( "unmatched '%s' token has been found." % self.__end ) + #elif decl_string[ found ] == self.__end: + # print args + # raise RuntimeError( "unmatched '%s' token has been found." % self.__end ) else: args.append( args_only[ previous_found : found ] ) previous_found = found + 1 #skip found sep Modified: pygccxml_dev/unittests/call_invocation_tester.py =================================================================== --- pygccxml_dev/unittests/call_invocation_tester.py 2006-09-17 08:46:42 UTC (rev 547) +++ pygccxml_dev/unittests/call_invocation_tester.py 2006-09-18 08:18:09 UTC (rev 548) @@ -14,11 +14,11 @@ class tester_t( unittest.TestCase ): def __init__(self, *args ): unittest.TestCase.__init__( self, *args ) - + def __test_split_impl(self, decl_string, name, args): self.failUnless( ( name, args ) == declarations.call_invocation.split( decl_string ) ) - def __test_split_recursive_impl(self, decl_string, control_seq): + def __test_split_recursive_impl(self, decl_string, control_seq): self.failUnless( control_seq == declarations.call_invocation.split_recursive( decl_string ) ) def __test_is_call_invocation_impl( self, decl_string ): @@ -26,7 +26,7 @@ def test_split_on_vector(self): self.__test_is_call_invocation_impl( "vector(int,std::allocator(int) )" ) - + self.__test_split_impl( "vector(int,std::allocator(int) )" , "vector" , [ "int", "std::allocator(int)" ] ) @@ -37,14 +37,14 @@ def test_split_on_string(self): self.__test_is_call_invocation_impl( "basic_string(char,std::char_traits(char),std::allocator(char) )" ) - + self.__test_split_impl( "basic_string(char,std::char_traits(char),std::allocator(char) )" , "basic_string" , [ "char", "std::char_traits(char)", "std::allocator(char)" ] ) - + def test_split_on_map(self): self.__test_is_call_invocation_impl( "map(long int,std::vector(int, std::allocator(int) ),std::less(long int),std::allocator(std::pair(const long int, std::vector(int, std::allocator(int) ) ) ) )" ) - + self.__test_split_impl( "map(long int,std::vector(int, std::allocator(int) ),std::less(long int),std::allocator(std::pair(const long int, std::vector(int, std::allocator(int) ) ) ) )" , "map" , [ "long int" @@ -53,7 +53,7 @@ , "std::allocator(std::pair(const long int, std::vector(int, std::allocator(int) ) ) )" ] ) def test_join_on_vector(self): - self.failUnless( "vector( int, std::allocator(int) )" + self.failUnless( "vector( int, std::allocator(int) )" == declarations.call_invocation.join("vector", ( "int", "std::allocator(int)" ) ) ) def test_find_args(self): @@ -67,9 +67,15 @@ self.failUnless( (1,9) == found ) found = declarations.call_invocation.find_args( temp, found[1]+1 ) self.failUnless( (10, 14) == found ) - + + def test_bug_unmatched_brace( self ): + src = 'AlternativeName((&string("")), (&string("")), (&string("")))' + self.__test_split_impl( src + , 'AlternativeName' + , ['(&string(""))', '(&string(""))', '(&string(""))'] ) + def create_suite(): - suite = unittest.TestSuite() + suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) return suite @@ -77,4 +83,4 @@ unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": - run_suite() \ No newline at end of file + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |