Ejemplo n.º 1
0
static void parseVimFile (const unsigned char *line)
{
	boolean readNextLine = TRUE;

	while (line != NULL)
	{
		readNextLine = parseVimLine(line);

		if ( readNextLine )
			line = readVimLine();

	}
}
Ejemplo n.º 2
0
Archivo: vim.c Proyecto: Monits/ctags
static void parseFunction (const unsigned char *line)
{
	vString *name = vStringNew ();
	/* boolean inFunction = FALSE; */
	int scope;
	const unsigned char *cp = line;

	if ((int) *cp == '!')
		++cp;
	if (isspace ((int) *cp))
	{
		while (*cp && isspace ((int) *cp))
			++cp;

		if (*cp)
		{
			cp = skipPrefix (cp, &scope);
			if (isupper ((int) *cp)  ||  
					scope == 's'  ||  /* script scope */
					scope == '<'  ||  /* script scope */
					scope == 'd'  ||  /* dictionary */
					scope == 'a')	  /* autoload */
			{
				do
				{
					vStringPut (name, (int) *cp);
					++cp;
				} while (isalnum ((int) *cp) ||  *cp == '_' ||	*cp == '.' ||  *cp == '#');
				vStringTerminate (name);
				makeSimpleTag (name, VimKinds, K_FUNCTION);
				vStringClear (name);
			}
		}
	}

	/* TODO - update struct to indicate inside function */
	while ((line = readVimLine ()) != NULL)
	{
		if (wordMatchLen (line, "endfunction", 4))
			break;

		parseVimLine(line, TRUE);
	}
	vStringDelete (name);
}