Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 14 Jul 2013 18:34:44 UTC Commit: b39f90c94d54dd80e1f025e90c03fbf6455fadb9 https://github.com/geany/geany/commit/b39f90c94d54dd80e1f025e90c03fbf6455fad...
Log Message: ----------- C++11, C#: Fix parsing of enums with a base type inside classes
Modified Paths: -------------- tagmanager/ctags/c.c tests/ctags/Makefile.am tests/ctags/cxx11enum.cpp tests/ctags/cxx11enum.cpp.tags tests/ctags/keyword_enum.cs.tags
Modified: tagmanager/ctags/c.c 16 files changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -2629,14 +2629,6 @@ static void processColon (statementInfo *const st) { readParents (st, ':'); } - else if (parentDecl (st) == DECL_STRUCT || parentDecl (st) == DECL_CLASS) - { - c = skipToOneOf (",;"); - if (c == ',') - setToken (st, TOKEN_COMMA); - else if (c == ';') - setToken (st, TOKEN_SEMICOLON); - } else if ((isLanguage (Lang_cpp) || isLanguage (Lang_csharp)) && st->declaration == DECL_ENUM) { @@ -2647,6 +2639,14 @@ static void processColon (statementInfo *const st) else if (c == ';') setToken (st, TOKEN_SEMICOLON); } + else if (parentDecl (st) == DECL_STRUCT || parentDecl (st) == DECL_CLASS) + { + c = skipToOneOf (",;"); + if (c == ',') + setToken (st, TOKEN_COMMA); + else if (c == ';') + setToken (st, TOKEN_SEMICOLON); + } else { const tokenInfo *const prev = prevToken (st, 1);
Modified: tests/ctags/Makefile.am 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -113,6 +113,7 @@ test_sources = \ countall.sql \ cpp_destructor.cpp \ cython_sample.pyx \ + cxx11enum.cpp \ db-trig.sql \ debian_432872.f90 \ directives.c \
Modified: tests/ctags/cxx11enum.cpp 9 files changed, 9 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,9 @@ + +enum A:int {A_a, A_b, A_c}; +enum B:long {B_a, B_b, B_c}; +enum C:unsigned int {C_a, C_b, C_c}; + +class Foo { + enum D:int {a, b, c}; + virtual void foo(enum D a); +};
Modified: tests/ctags/cxx11enum.cpp.tags 19 files changed, 19 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,19 @@ +# format=tagmanager +A�2�0 +A_a�4�A�0 +A_b�4�A�0 +A_c�4�A�0 +B�2�0 +B_a�4�B�0 +B_b�4�B�0 +B_c�4�B�0 +C�2�0 +C_a�4�C�0 +C_b�4�C�0 +C_c�4�C�0 +D�2�Foo�0 +Foo�1�0 +a�4�Foo::D�0 +b�4�Foo::D�0 +c�4�Foo::D�0 +foo�1024�(enum D a)�Foo�0�virtual void
Modified: tests/ctags/keyword_enum.cs.tags 4 files changed, 3 insertions(+), 1 deletions(-) =================================================================== @@ -3,8 +3,10 @@ Days EnumTest�1�0 Fri�4�EnumTest.Days�0 Main�128�()�EnumTest�0�public void +Max�4�EnumTest.Range�0 +Min�4�EnumTest.Range�0 Mon�4�EnumTest.Days�0 -Range�2048�0 +Range�2�EnumTest�0 Sat�4�EnumTest.Days�0 Sun�4�EnumTest.Days�0 Thu�4�EnumTest.Days�0
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).