Fixed missing tags for Korn shell specific function definitions.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@329 c5d04d22-be80-434c-894e-aa346cc9e8e8
This commit is contained in:
parent
eb67b198a9
commit
0b212331f2
1
NEWS
1
NEWS
|
@ -4,6 +4,7 @@ ctags-5.5.1 (Tue Jun 10 2003)
|
|||
* Fixed compilation error for uncommon hosts.
|
||||
* Restored exit of program after --help, --license, and --version options [Bug
|
||||
#717311, #751240].
|
||||
* Fixed missing tags for Korn shell specific function definitions. [Sh]
|
||||
* Allowed semicolon as statement separator [Fortran, Bug #734933].
|
||||
|
||||
ctags-5.5 (Tue Apr 1 2003)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/ksh
|
||||
|
||||
f1() {
|
||||
}
|
||||
|
||||
function f2 {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
f1() {
|
||||
}
|
||||
|
||||
function f2() {
|
||||
}
|
58
sh.c
58
sh.c
|
@ -56,40 +56,44 @@ static void findShTags (void)
|
|||
|
||||
while ((line = fileReadLine ()) != NULL)
|
||||
{
|
||||
const unsigned char* cp = line;
|
||||
boolean functionFound = FALSE;
|
||||
|
||||
if (line [0] == '#')
|
||||
continue;
|
||||
|
||||
if (strchr ((const char*) line, '(') != NULL)
|
||||
while (isspace (*cp))
|
||||
cp++;
|
||||
if (strncmp ((const char*) cp, "function", (size_t) 8) == 0 &&
|
||||
isspace ((int) cp [8]))
|
||||
{
|
||||
const unsigned char* cp = line;
|
||||
|
||||
while (isspace (*cp))
|
||||
cp++;
|
||||
|
||||
if (strncmp ((const char*) cp, "function", (size_t) 8) == 0 &&
|
||||
isspace ((int) cp [8]))
|
||||
{
|
||||
cp += 8;
|
||||
}
|
||||
functionFound = TRUE;
|
||||
cp += 8;
|
||||
if (! isspace ((int) *cp))
|
||||
continue;
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
if (*cp++ == '(')
|
||||
{
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
if (*cp == ')' && ! hackReject (name))
|
||||
makeSimpleTag (name, ShKinds, K_FUNCTION);
|
||||
}
|
||||
vStringClear (name);
|
||||
}
|
||||
if (! isalnum ((int) *cp))
|
||||
continue;
|
||||
while (isalnum ((int) *cp) || *cp == '_')
|
||||
{
|
||||
vStringPut (name, (int) *cp);
|
||||
++cp;
|
||||
}
|
||||
vStringTerminate (name);
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
if (*cp++ == '(')
|
||||
{
|
||||
while (isspace ((int) *cp))
|
||||
++cp;
|
||||
if (*cp == ')' && ! hackReject (name))
|
||||
functionFound = TRUE;
|
||||
}
|
||||
if (functionFound)
|
||||
makeSimpleTag (name, ShKinds, K_FUNCTION);
|
||||
vStringClear (name);
|
||||
}
|
||||
vStringDelete (name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue