From: <ma...@us...> - 2009-07-14 12:05:15
|
Revision: 11393 http://swig.svn.sourceforge.net/swig/?rev=11393&view=rev Author: matevz Date: 2009-07-14 12:05:05 +0000 (Tue, 14 Jul 2009) Log Message: ----------- Added keyword 'thread_local' to Swig. Added testcase. Modified Paths: -------------- branches/gsoc2009-matevz/Examples/test-suite/common.mk branches/gsoc2009-matevz/Source/CParse/cscanner.c branches/gsoc2009-matevz/Source/CParse/parser.y Added Paths: ----------- branches/gsoc2009-matevz/Examples/test-suite/cpp0x_thread_local.i Modified: branches/gsoc2009-matevz/Examples/test-suite/common.mk =================================================================== --- branches/gsoc2009-matevz/Examples/test-suite/common.mk 2009-07-13 11:47:40 UTC (rev 11392) +++ branches/gsoc2009-matevz/Examples/test-suite/common.mk 2009-07-14 12:05:05 UTC (rev 11393) @@ -404,7 +404,8 @@ cpp0x_explicit_conversion_operators \ cpp0x_raw_string_literals \ cpp0x_static_assert \ - cpp0x_template_explicit + cpp0x_template_explicit \ + cpp0x_thread_local # cpp0x_constexpr # not supported by any compilers yet # Broken C++0x test cases. Added: branches/gsoc2009-matevz/Examples/test-suite/cpp0x_thread_local.i =================================================================== --- branches/gsoc2009-matevz/Examples/test-suite/cpp0x_thread_local.i (rev 0) +++ branches/gsoc2009-matevz/Examples/test-suite/cpp0x_thread_local.i 2009-07-14 12:05:05 UTC (rev 11393) @@ -0,0 +1,11 @@ +/* This testcase checks whether Swig correctly parses the 'thread_local' + keyword before the member type and name. */ + +%module cpp0x_thread_local + +%inline %{ +struct A { + thread_local int val; +}; +%} + Modified: branches/gsoc2009-matevz/Source/CParse/cscanner.c =================================================================== --- branches/gsoc2009-matevz/Source/CParse/cscanner.c 2009-07-13 11:47:40 UTC (rev 11392) +++ branches/gsoc2009-matevz/Source/CParse/cscanner.c 2009-07-14 12:05:05 UTC (rev 11393) @@ -632,6 +632,8 @@ return (FRIEND); if (strcmp(yytext, "constexpr") == 0) return (CONSTEXPR); + if (strcmp(yytext, "thread_local") == 0) + return (THREAD_LOCAL); if (strcmp(yytext, "virtual") == 0) return (VIRTUAL); if (strcmp(yytext, "static_assert") == 0) Modified: branches/gsoc2009-matevz/Source/CParse/parser.y =================================================================== --- branches/gsoc2009-matevz/Source/CParse/parser.y 2009-07-13 11:47:40 UTC (rev 11392) +++ branches/gsoc2009-matevz/Source/CParse/parser.y 2009-07-14 12:05:05 UTC (rev 11393) @@ -1492,8 +1492,8 @@ %token ILLEGAL CONSTANT %token NAME RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS %token ENUM -%token CLASS TYPENAME PRIVATE PUBLIC PROTECTED COLON STATIC VIRTUAL FRIEND THROW CATCH EXPLICIT CONSTEXPR -%token STATIC_ASSERT +%token CLASS TYPENAME PRIVATE PUBLIC PROTECTED COLON STATIC VIRTUAL FRIEND THROW CATCH EXPLICIT +%token STATIC_ASSERT CONSTEXPR THREAD_LOCAL /* C++0x keywords */ %token USING %token <node> NAMESPACE %token NATIVE INLINE @@ -4507,6 +4507,7 @@ | FRIEND { $$ = "friend"; } | EXPLICIT { $$ = "explicit"; } | CONSTEXPR { $$ = "constexpr"; } + | THREAD_LOCAL { $$ = "thread_local"; } | empty { $$ = 0; } ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |