diff --git a/Tmain/list-kinds-full.d/stdout-expected.txt b/Tmain/list-kinds-full.d/stdout-expected.txt index 14b82eda07..ad6535cdc9 100644 --- a/Tmain/list-kinds-full.d/stdout-expected.txt +++ b/Tmain/list-kinds-full.d/stdout-expected.txt @@ -1,7 +1,7 @@ #LETTER NAME ENABLED REFONLY NROLES MASTER DESCRIPTION D macroparam no no 0 C parameters inside macro definitions L label no no 0 C goto labels -Y unknown no yes 3 C unknown identifier +Y unknown no yes 4 C unknown identifier d macro yes no 2 C macro definitions e enumerator yes no 0 C enumerators (values inside an enumeration) f function yes no 0 C function definitions @@ -22,7 +22,7 @@ D macroparam no no 0 C parameters inside macro definitions L label no no 0 C goto labels N name no no 0 NONE names imported via using scope::symbol U using no no 0 NONE using namespace statements -Y unknown no yes 3 C unknown identifier +Y unknown no yes 4 C unknown identifier Z tparam no no 0 NONE template parameters c class yes no 0 NONE classes d macro yes no 2 C macro definitions diff --git a/Tmain/list-roles.d/stdout-expected.txt b/Tmain/list-roles.d/stdout-expected.txt index 0bdf25e18c..24fab3e69a 100644 --- a/Tmain/list-roles.d/stdout-expected.txt +++ b/Tmain/list-roles.d/stdout-expected.txt @@ -18,6 +18,7 @@ Automake d/directory program on directory for PROGRA Automake d/directory script on directory for SCRIPTS primary Basic f/function decl on declared Bats S/script loaded on script loaed with "load" command +C Y/unknown applied on (maybe macro, function, or member) called or expanded C Y/unknown defvar on (maybe type) used for defining variables C Y/unknown ref off referenced anyhow C Y/unknown value on used as right side value @@ -26,6 +27,7 @@ C d/macro undef on undefined C h/header local on local header C h/header system on system header C m/member initialized on initialized with form '.member = ...' +C++ Y/unknown applied on (maybe macro, function, or member) called or expanded C++ Y/unknown defvar on (maybe type) used for defining variables C++ Y/unknown ref off referenced anyhow C++ Y/unknown value on used as right side value @@ -38,6 +40,7 @@ CPreProcessor d/macro condition off used in part of #if/ CPreProcessor d/macro undef on undefined CPreProcessor h/header local on local header CPreProcessor h/header system on system header +CUDA Y/unknown applied on (maybe macro, function, or member) called or expanded CUDA Y/unknown defvar on (maybe type) used for defining variables CUDA Y/unknown ref off referenced anyhow CUDA Y/unknown value on used as right side value @@ -149,6 +152,7 @@ Automake d/directory program on directory for PROGRA Automake d/directory script on directory for SCRIPTS primary Basic f/function decl on declared Bats S/script loaded on script loaed with "load" command +C Y/unknown applied on (maybe macro, function, or member) called or expanded C Y/unknown defvar on (maybe type) used for defining variables C Y/unknown ref off referenced anyhow C Y/unknown value on used as right side value @@ -157,6 +161,7 @@ C d/macro undef on undefined C h/header local on local header C h/header system on system header C m/member initialized on initialized with form '.member = ...' +C++ Y/unknown applied on (maybe macro, function, or member) called or expanded C++ Y/unknown defvar on (maybe type) used for defining variables C++ Y/unknown ref off referenced anyhow C++ Y/unknown value on used as right side value @@ -169,6 +174,7 @@ CPreProcessor d/macro condition off used in part of #if/ CPreProcessor d/macro undef on undefined CPreProcessor h/header local on local header CPreProcessor h/header system on system header +CUDA Y/unknown applied on (maybe macro, function, or member) called or expanded CUDA Y/unknown defvar on (maybe type) used for defining variables CUDA Y/unknown ref off referenced anyhow CUDA Y/unknown value on used as right side value @@ -265,6 +271,7 @@ Zsh s/script loaded on loaded # C.* # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -306,6 +313,7 @@ s/script loaded on loaded # C.* with disabling all roles of all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -319,6 +327,7 @@ m/member initialized off initialized with form '.member = ...' # C.* with disabling all roles of all kinds of all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -333,6 +342,7 @@ m/member initialized off initialized with form '.member = ...' # after disabling system role of header kind of C language # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref on referenced anyhow Y/unknown value on used as right side value @@ -347,6 +357,7 @@ m/member initialized on initialized with form '.member = ...' # after disabling system role of header kind of C language # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref on referenced anyhow Y/unknown value on used as right side value @@ -360,6 +371,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with disabling all roles in C language # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -380,6 +392,7 @@ s/script loaded on loaded # C.* with disabling all roles of all kinds in C language # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -401,6 +414,7 @@ s/script loaded on loaded # after disabling all roles in all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref on referenced anyhow Y/unknown value on used as right side value @@ -423,6 +437,7 @@ s/script loaded off loaded # after disabling all roles in all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref on referenced anyhow Y/unknown value on used as right side value @@ -444,6 +459,7 @@ s/script loaded off loaded # C.* with disabling all roles of {header} kind in C language # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -464,6 +480,7 @@ s/script loaded on loaded # C.* with disabling all roles of h kind in C language # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -485,6 +502,7 @@ s/script loaded on loaded # after disabling all roles in all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -507,6 +525,7 @@ s/script loaded off loaded # after disabling all roles in all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -528,6 +547,7 @@ s/script loaded off loaded # C.* with disabling system role of h kind # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -541,6 +561,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with disabling system role of {header} kind # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -554,6 +575,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with enabling system role of h kind after disabling the role # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -567,6 +589,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with enabling system role of {header} kind after disabling the role # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -580,6 +603,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with disabling system and local roles of h kind # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -593,6 +617,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with disabling system and local roles of {header} kind # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -607,6 +632,7 @@ m/member initialized on initialized with form '.member = ...' # after disabling all roles in all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -621,6 +647,7 @@ m/member initialized off initialized with form '.member = ...' # after disabling all roles in all languages # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -634,6 +661,7 @@ m/member initialized off initialized with form '.member = ...' # C.* with disabling local role of h kind and undef role of d kind # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -647,6 +675,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with enabling all roles of header kinds after disabling all roles of the kind # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied on (maybe macro, function, or member) called or expanded Y/unknown defvar on (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value on used as right side value @@ -660,6 +689,7 @@ m/member initialized on initialized with form '.member = ...' # C.* with enabling all roles of header kinds after disabling all roles of the kinds of C language # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value @@ -673,6 +703,7 @@ m/member initialized off initialized with form '.member = ...' # C.* with enabling all roles of header kinds after disabling all roles of the kinds of C language (short notation) # #KIND(L/N) NAME ENABLED DESCRIPTION +Y/unknown applied off (maybe macro, function, or member) called or expanded Y/unknown defvar off (maybe type) used for defining variables Y/unknown ref off referenced anyhow Y/unknown value off used as right side value diff --git a/Tmain/nested-subparsers.d/stdout-expected.txt b/Tmain/nested-subparsers.d/stdout-expected.txt index a83115aef3..f0494c96e0 100644 --- a/Tmain/nested-subparsers.d/stdout-expected.txt +++ b/Tmain/nested-subparsers.d/stdout-expected.txt @@ -37,7 +37,7 @@ n name #LETTER NAME ENABLED REFONLY NROLES MASTER DESCRIPTION D macroparam no no 0 C parameters inside macro definitions L label no no 0 C goto labels -Y unknown no yes 3 C unknown identifier +Y unknown no yes 4 C unknown identifier d macro yes no 2 C macro definitions e enumerator yes no 0 C enumerators (values inside an enumeration) f function yes no 0 C function definitions diff --git a/Units/parser-c.r/c-reftags-unknown-ref.d/expected.tags b/Units/parser-c.r/c-reftags-unknown-ref.d/expected.tags index 78de11b7fb..d2687c75f1 100644 --- a/Units/parser-c.r/c-reftags-unknown-ref.d/expected.tags +++ b/Units/parser-c.r/c-reftags-unknown-ref.d/expected.tags @@ -10,4 +10,4 @@ j input.c /^ if (j == 0)$/;" Y function:f roles:ref i input.c /^ return i + B + j + f(0);$/;" Y function:f roles:ref B input.c /^ return i + B + j + f(0);$/;" Y function:f roles:ref j input.c /^ return i + B + j + f(0);$/;" Y function:f roles:ref -f input.c /^ return i + B + j + f(0);$/;" Y function:f roles:ref +f input.c /^ return i + B + j + f(0);$/;" Y function:f roles:applied diff --git a/parsers/cxx/cxx_reftag.c b/parsers/cxx/cxx_reftag.c index 2f4e5682e9..efd5eba1c6 100644 --- a/parsers/cxx/cxx_reftag.c +++ b/parsers/cxx/cxx_reftag.c @@ -40,6 +40,21 @@ void cxxReftagEvalNewToken(void) if (in_subparser) popLanguage(); } + else if (cxxTokenTypeIs(g_cxx.pToken,CXXTokenTypeOpeningParenthesis) + && cxxTagKindEnabled(CXXTagKindUNKNOWN) && + cxxTagRoleEnabled(CXXTagKindUNKNOWN, CXXTagUnknownRoleAPPLIED)) + { + if(g_cxx.pToken->pPrev && cxxTokenTypeIs(g_cxx.pToken->pPrev, + CXXTokenTypeIdentifier)) + { + CXXToken * i = g_cxx.pToken->pPrev; + if(i->iCorkIndex != CORK_NIL && i->bCorkIndexForReftag) + cxxReftagReset(i->iCorkIndex, CORK_NIL, + CXXTagKindUNKNOWN, CXXTagUnknownRoleAPPLIED, false); + else + ; + } + } } void cxxReftagReset(int iCorkIndex, int iScopeCorkIndex, diff --git a/parsers/cxx/cxx_tag.c b/parsers/cxx/cxx_tag.c index 8687c4612e..a97103b016 100644 --- a/parsers/cxx/cxx_tag.c +++ b/parsers/cxx/cxx_tag.c @@ -25,6 +25,7 @@ { false, "ref", "referenced anyhow" }, \ { true, "value", "used as right side value" }, \ { true, "defvar", "(maybe type) used for defining variables" }, \ + { true, "applied", "(maybe macro, function, or member) called or expanded" }, \ } CXX_COMMON_UNKNOWN_ROLES(C); diff --git a/parsers/cxx/cxx_tag.h b/parsers/cxx/cxx_tag.h index c0f5d4233d..3187f2e904 100644 --- a/parsers/cxx/cxx_tag.h +++ b/parsers/cxx/cxx_tag.h @@ -45,6 +45,7 @@ enum CXXTagUnknownRole CXXTagUnknownRoleREFERENCED, CXXTagUnknownRoleVALUE, CXXTagUnknownRoleDEFVAR, + CXXTagUnknownRoleAPPLIED, }; enum CXXTagMemberRole