Beispiel #1
0
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);
	}
Beispiel #2
0
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);
	}
Beispiel #3
0
static void makeAsciidocTag (const vString* const name, const int kind)
{
	const NestingLevel *const nl = getNestingLevel(kind);

	if (vStringLength (name) > 0)
	{
		tagEntryInfo e;
		initTagEntry (&e, vStringValue (name), &(AsciidocKinds [kind]));

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

		if (nl && nl->type < kind)
		{
			e.extensionFields.scopeKind = &(AsciidocKinds [nl->type]);
			e.extensionFields.scopeName = vStringValue (nl->name);
		}
		makeTagEntry (&e);
	}
	nestingLevelsPush(nestingLevels, name, kind);
}
Beispiel #4
0
static void makeRstTag(const vString* const name, const int kind, const fpos_t filepos)
{
    const NestingLevel *const nl = getNestingLevel(kind);

    if (vStringLength (name) > 0)
    {
        tagEntryInfo e;
        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);
        }
        makeTagEntry (&e);
    }
    nestingLevelsPush(nestingLevels, name, kind);
}