static void findVimTags (void){ vString *name = vStringNew (); const unsigned char *line; boolean inFunction = FALSE; int scope; while ((line = fileReadLine ()) != NULL) { while (isspace ((int) *line)) ++line; if ((int) *line == '"') continue; /* skip comment */ if (strncmp ((const char*) line, "fu", (size_t) 2) == 0) { const unsigned char *cp = line + 1; inFunction = TRUE; if ((int) *++cp == 'n' && (int) *++cp == 'c' && (int) *++cp == 't' && (int) *++cp == 'i' && (int) *++cp == 'o' && (int) *++cp == 'n') ++cp; if ((int) *cp == '!') ++cp; if (isspace ((int) *cp)) { while (isspace ((int) *cp)) ++cp; cp = skipPrefix (cp, &scope); if (isupper ((int) *cp) || scope == 's' || scope == '<') { do { vStringPut (name, (int) *cp); ++cp; } while (isalnum ((int) *cp) || *cp == '_'); vStringTerminate (name); makeSimpleTag (name, VimKinds, K_FUNCTION); vStringClear (name); } } } if (strncmp ((const char*) line, "aug", (size_t) 3) == 0) { /* Found Autocommand Group (augroup) */ const unsigned char *cp = line + 2; if ((int) *++cp == 'r' && (int) *++cp == 'o' && (int) *++cp == 'u' && (int) *++cp == 'p') ++cp; if (isspace ((int) *cp)) { while (isspace ((int) *cp)) ++cp; if (strncasecmp ((const char*) cp, "end", (size_t) 3) != 0) { do { vStringPut (name, (int) *cp); ++cp; } while (isalnum ((int) *cp) || *cp == '_'); vStringTerminate (name); makeSimpleTag (name, VimKinds, K_AUGROUP); vStringClear (name); } } } if (strncmp ((const char*) line, "endf", (size_t) 4) == 0) inFunction = FALSE; if (!inFunction && strncmp ((const char*) line, "let", (size_t) 3) == 0) { /* we've found a variable declared outside of a function!! */ const unsigned char *cp = line + 3; /* get the name */ if (isspace ((int) *cp)) { /* deal with spaces, $, @ and & */ while (!isalnum ((int) *cp)) ++cp; cp = skipPrefix (cp, &scope); do { vStringPut (name, (int) *cp); ++cp; } while (isalnum ((int) *cp) || *cp == '_'); vStringTerminate (name); makeSimpleTag (name, VimKinds, K_VARIABLE); vStringClear (name); } } } vStringDelete (name);}