Пример #1
0
Файл: rst.c Проект: alx741/ctags
static void makeRstTag(const vString* const name, const int kind, const MIOPos filepos,
		       char marker)
{
	const NestingLevel *const nl = getNestingLevel(kind);

	if (vStringLength (name) > 0)
	{
		tagEntryInfo e;
		char m [2] = { [1] = '\0' };

		initTagEntry (&e, vStringValue (name), &(RstKinds [kind]));

		e.lineNumber--;	/* we want the line before the '---' underline chars */
		e.filePosition = filepos;

		if (nl && nl->kindIndex < kind)
		{
			e.extensionFields.scopeKind = &(RstKinds [nl->kindIndex]);
			e.extensionFields.scopeName = vStringValue (nl->name);
		}

		m[0] = marker;
		attachParserField (&e, RstFields [F_SECTION_MARKER].ftype, m);
		makeTagEntry (&e);
	}
Пример #2
0
void cxxTagSetField(unsigned int uField,const char * szValue)
{
	CXX_DEBUG_ASSERT(
			uField < g_cxx.uFieldOptionCount,
			"The field must be associated to the current language!"
		);

	if(!g_cxx.pFieldOptions[uField].enabled)
		return;

	attachParserField(&g_oCXXTag,g_cxx.pFieldOptions[uField].ftype,szValue);
}
Пример #3
0
Файл: rst.c Проект: pjkack/ctags
static void makeRstTag(const vString* const name, const int kind, const MIOPos filepos,
		       char marker)
{
	const NestingLevel *const nl = getNestingLevel(kind);
	tagEntryInfo *parent;

	int r = CORK_NIL;

	if (vStringLength (name) > 0)
	{
		tagEntryInfo e;
		char m [2] = { [1] = '\0' };

		initTagEntry (&e, vStringValue (name), &(RstKinds [kind]));

		e.lineNumber--;	/* we want the line before the '---' underline chars */
		e.filePosition = filepos;

		parent = getEntryOfNestingLevel (nl);
		if (parent && ((parent->kind - RstKinds) < kind))
		{
#if 1
			e.extensionFields.scopeKind = &(RstKinds [parent->kind - RstKinds]);
			e.extensionFields.scopeName = parent->name;
#else
			/* TODO

			   Following code makes the scope information full qualified form.
			   Do users want the full qualified form?
			   --- ./Units/rst.simple.d/expected.tags	2015-12-18 01:32:35.574255617 +0900
			   +++ /home/yamato/var/ctags-github/Units/rst.simple.d/FILTERED.tmp	2016-05-05 03:05:38.165604756 +0900
			   @@ -5,2 +5,2 @@
			   -Subsection 1.1.1	input.rst	/^Subsection 1.1.1$/;"	S	section:Section 1.1
			   -Subsubsection 1.1.1.1	input.rst	/^Subsubsection 1.1.1.1$/;"	t	subsection:Subsection 1.1.1
			   +Subsection 1.1.1	input.rst	/^Subsection 1.1.1$/;"	S	section:Chapter 1.Section 1.1
			   +Subsubsection 1.1.1.1	input.rst	/^Subsubsection 1.1.1.1$/;"	t	subsection:Chapter 1.Section 1.1.Subsection 1.1.1
			*/
			   e.extensionFields.scopeIndex = nl->corkIndex;
#endif
		}

		m[0] = marker;
		attachParserField (&e, RstFields [F_SECTION_MARKER].ftype, m);
		r = makeTagEntry (&e);
	}
Пример #4
0
static int makeClassTag (const tokenInfo *const token,
                         const vString *const inheritance,
                         const vString *const decorators)
{
	if (PythonKinds[K_CLASS].enabled)
	{
		tagEntryInfo e;

		initPythonEntry (&e, token, K_CLASS);

		e.extensionFields.inheritance = inheritance ? vStringValue (inheritance) : "";
		if (decorators && vStringLength (decorators) > 0)
		{
			attachParserField (&e, PythonFields[F_DECORATORS].ftype,
			                   vStringValue (decorators));
		}

		return makeTagEntry (&e);
	}

	return CORK_NIL;
}
Пример #5
0
static int makeFunctionTag (const tokenInfo *const token,
                            const vString *const arglist,
                            const vString *const decorators)
{
	if (PythonKinds[K_FUNCTION].enabled)
	{
		tagEntryInfo e;

		initPythonEntry (&e, token, K_FUNCTION);

		if (arglist)
			e.extensionFields.signature = vStringValue (arglist);
		if (decorators && vStringLength (decorators) > 0)
		{
			attachParserField (&e, PythonFields[F_DECORATORS].ftype,
			                   vStringValue (decorators));
		}

		return makeTagEntry (&e);
	}

	return CORK_NIL;
}