예제 #1
0
파일: asm.c 프로젝트: FabianInostroza/geany
static void makeAsmTag (
    const vString *const name,
    const vString *const operator,
    const boolean labelCandidate,
    const boolean nameFollows)
{
    if (vStringLength (name) > 0)
    {
        boolean found;
        const AsmKind kind = operatorKind (operator, &found);
        if (found)
        {
            if (kind != K_NONE)
                makeSimpleTag (name, AsmKinds, kind);
        }
        else if (isDefineOperator (operator))
        {
            if (! nameFollows)
                makeSimpleTag (name, AsmKinds, K_DEFINE);
        }
        else if (labelCandidate)
        {
            operatorKind (name, &found);
            if (! found)
                makeSimpleTag (name, AsmKinds, K_LABEL);
        }
    }
}
예제 #2
0
파일: asm.c 프로젝트: seafitliu/ctags
static void makeAsmTag (
		const vString *const name,
		const vString *const operator,
		const bool labelCandidate,
		const bool nameFollows,
		const bool directive,
		unsigned int *lastMacroCorkIndex)
{
	if (vStringLength (name) > 0)
	{
		bool found;
		const AsmKind kind = operatorKind (operator, &found);
		if (found)
		{
			if (kind > K_NONE)
				makeSimpleTag (name, kind);
		}
		else if (isDefineOperator (operator))
		{
			if (! nameFollows)
				makeSimpleTag (name, K_DEFINE);
		}
		else if (labelCandidate)
		{
			operatorKind (name, &found);
			if (! found)
				makeSimpleTag (name, K_LABEL);
		}
		else if (directive)
		{
			bool found_dummy;
			const AsmKind kind_for_directive = operatorKind (name, &found_dummy);
			tagEntryInfo *macro_tag;

			switch (kind_for_directive)
			{
			case K_NONE:
				break;
			case K_MACRO:
				*lastMacroCorkIndex = makeSimpleTag (operator,
													 kind_for_directive);
				break;
			case K_PSUEDO_MACRO_END:
				if (*lastMacroCorkIndex != CORK_NIL)
				{
					macro_tag = getEntryInCorkQueue (*lastMacroCorkIndex);
					macro_tag->extensionFields.endLine = getInputLineNumber ();
					*lastMacroCorkIndex = CORK_NIL;
				}
				break;
			case K_SECTION:
				makeSimpleRefTag (operator,
								  kind_for_directive,
								  ASM_SECTION_PLACEMENT);
				break;
			default:
				makeSimpleTag (operator, kind_for_directive);
			}
		}
	}
}