Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added support for ASP classes, contributed by Zendhi Nagao; changes m…

…eaning of c kind flag.
  • Loading branch information...
commit c8a43999bbc1d62709aa3c1fabd85573790558a7 1 parent fbaa7e1
Darren Hiebert authored
Showing with 121 additions and 2 deletions.
  1. +2 −0  NEWS
  2. +119 −2 asp.c
View
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].
View
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: */
+
Please sign in to comment.
Something went wrong with that request. Please try again.