Added support for ASP classes, contributed by Zendhi Nagao; changes meaning of c kind flag.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@711 c5d04d22-be80-434c-894e-aa346cc9e8e8
This commit is contained in:
parent
346220ce41
commit
9108b1b1ca
2
NEWS
2
NEWS
|
@ -6,6 +6,8 @@ ctags-@VERSION@ (@DATE@)
|
|||
* Added support for new language: VHDL, contributed by Nicolas Vincent [VHDL, Bug #1943306].
|
||||
* Added regex support when compiling with MinGW. Gnu regex module now included in all distributions.
|
||||
* Added support for class and member variables [PHP, Bug #1037086].
|
||||
* Added support for recent enhancements to Eiffel language [Eiffel].
|
||||
* Added support for ASP classes, contributed by Zendhi Nagao; changes meaning of 'c' kind flag [ASP].
|
||||
* Fixed detection of triple strings inside other strings [Python, Bug #1988130].
|
||||
* Fixed an endless loop with comments in triple strings [Python, Bug #1988027].
|
||||
* Fixed bug where functions were sometimes seen as methods [Python, Bug #1988026].
|
||||
|
|
121
asp.c
121
asp.c
|
@ -25,11 +25,12 @@
|
|||
* DATA DEFINITIONS
|
||||
*/
|
||||
typedef enum {
|
||||
K_CONST, K_FUNCTION, K_SUB, K_DIM
|
||||
K_CONST, K_CLASS, K_FUNCTION, K_SUB, K_DIM
|
||||
} aspKind;
|
||||
|
||||
static kindOption AspKinds [] = {
|
||||
{ TRUE, 'c', "constant", "constants"},
|
||||
{ TRUE, 'd', "constant", "constants"},
|
||||
{ TRUE, 'c', "class", "classes"},
|
||||
{ TRUE, 'f', "function", "functions"},
|
||||
{ TRUE, 's', "subroutine", "subroutines"},
|
||||
{ TRUE, 'v', "variable", "variables"}
|
||||
|
@ -112,6 +113,102 @@ static void findAspTags (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* class member? */
|
||||
else if (strncasecmp ((const char*) cp, "public", (size_t) 6) == 0)
|
||||
{
|
||||
cp += 6;
|
||||
if (isspace ((int) *cp))
|
||||
{
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
if (strncasecmp ((const char*) cp, "function", (size_t) 8) == 0)
|
||||
{
|
||||
cp+=8;
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
makeSimpleTag (name, AspKinds, K_FUNCTION);
|
||||
vStringClear (name);
|
||||
}
|
||||
else if (strncasecmp ((const char*) cp, "sub", (size_t) 3) == 0)
|
||||
{
|
||||
cp+=3;
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
makeSimpleTag (name, AspKinds, K_SUB);
|
||||
vStringClear (name);
|
||||
}
|
||||
else {
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
makeSimpleTag (name, AspKinds, K_DIM);
|
||||
vStringClear (name);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strncasecmp ((const char*) cp, "private", (size_t) 7) == 0)
|
||||
{
|
||||
cp += 7;
|
||||
if (isspace ((int) *cp))
|
||||
{
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
if (strncasecmp ((const char*) cp, "function", (size_t) 8) == 0)
|
||||
{
|
||||
cp+=8;
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
makeSimpleTag (name, AspKinds, K_FUNCTION);
|
||||
vStringClear (name);
|
||||
}
|
||||
else if (strncasecmp ((const char*) cp, "sub", (size_t) 3) == 0)
|
||||
{
|
||||
cp+=3;
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
makeSimpleTag (name, AspKinds, K_SUB);
|
||||
vStringClear (name);
|
||||
}
|
||||
else {
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
makeSimpleTag (name, AspKinds, K_DIM);
|
||||
vStringClear (name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* function? */
|
||||
else if (strncasecmp ((const char*) cp, "function", (size_t) 8) == 0)
|
||||
{
|
||||
|
@ -170,6 +267,25 @@ static void findAspTags (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* class declaration? */
|
||||
else if (strncasecmp ((const char*) cp, "class", (size_t) 5) == 0)
|
||||
{
|
||||
cp += 5;
|
||||
if (isspace ((int) *cp))
|
||||
{
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
makeSimpleTag (name, AspKinds, K_CLASS);
|
||||
vStringClear (name);
|
||||
}
|
||||
}
|
||||
|
||||
/* const declaration? */
|
||||
else if (strncasecmp ((const char*) cp, "const", (size_t) 5) == 0)
|
||||
{
|
||||
|
@ -209,3 +325,4 @@ extern parserDefinition* AspParser (void)
|
|||
}
|
||||
|
||||
/* vi:set tabstop=4 shiftwidth=4: */
|
||||
|
||||
|
|
Loading…
Reference in New Issue