Esempio n. 1
0
File: php.c Progetto: qzhuyan/ctags
static void makeClassOrIfaceTag (const phpKind kind, const tokenInfo *const token,
								 vString *const inheritance, const implType impl)
{
	if (PhpKinds[kind].enabled)
	{
		tagEntryInfo e;

		initPhpEntry (&e, token, kind, ACCESS_UNDEFINED);

		if (impl != IMPL_UNDEFINED)
			e.extensionFields.implementation = implToString (impl);
		if (vStringLength (inheritance) > 0)
			e.extensionFields.inheritance = vStringValue (inheritance);

		makePhpTagEntry (&e);
	}
}
Esempio n. 2
0
File: php.c Progetto: qzhuyan/ctags
static void makeFunctionTag (const tokenInfo *const token,
							 const vString *const arglist,
							 const accessType access, const implType impl)
{
	if (PhpKinds[K_FUNCTION].enabled)
	{
		tagEntryInfo e;

		initPhpEntry (&e, token, K_FUNCTION, access);

		if (impl != IMPL_UNDEFINED)
			e.extensionFields.implementation = implToString (impl);
		if (arglist)
			e.extensionFields.signature = vStringValue (arglist);

		makePhpTagEntry (&e);
	}
}
Esempio n. 3
0
static void makeFunctionTag (const tokenInfo *const token,
							 const vString *const arglist,
							 const vString *const rtype,
							 const accessType access, const implType impl)
{
	if (PhpKinds[K_FUNCTION].enabled)
	{
		tagEntryInfo e;

		initPhpEntry (&e, token, K_FUNCTION, access);

		if (impl != IMPL_UNDEFINED)
			e.extensionFields.implementation = implToString (impl);
		if (arglist)
			e.extensionFields.signature = vStringValue (arglist);
		if (rtype)
		{
			if ((vStringLength (rtype) == 4)
				&& (strcmp (vStringValue (rtype), "self") == 0)
				&& vStringLength (token->scope) > 0)
			{
				if (token->parentKind == -1)
					e.extensionFields.typeRef [0] = "unknown";
				else
					e.extensionFields.typeRef [0] = PhpKinds [token->parentKind].name;
				e.extensionFields.typeRef [1] = vStringValue (token->scope);
			}
			else if ((vStringLength (rtype) == 6)
				&& (strcmp (vStringValue (rtype), "parent") == 0)
				&& (ParentClass && vStringLength (ParentClass) > 0))
			{
				e.extensionFields.typeRef [0] = "class";
				e.extensionFields.typeRef [1] = vStringValue (ParentClass);
			}
			else
			{
				e.extensionFields.typeRef [0] = "unknown";
				e.extensionFields.typeRef [1] = vStringValue (rtype);
			}
		}

		makePhpTagEntry (&e);
	}
}