示例#1
0
//A vector of indice vectors.
//Each indice vector is a list of index references which together reference a single line of plaintext
static std::vector<std::vector<int>> into_plaintext_indices(TokenString& tokenstring) {
	std::vector<std::vector<int>> indices = { {} };
	int line = 0;
	for (unsigned int i = 0; i < tokenstring.tokens.size(); ++i) {
		PrintToken* next = &tokenstring.tokens[i];

		if (tokenIsType(*next,PrintTokenType::NEWLINE)) {
			++line;
			indices.push_back({});
		}

		if (tokenIsType(*next,PrintTokenType::TEXT)) {
			indices[line].push_back(i);
		}
	}

	return indices;
}
示例#2
0
文件: tcloo.c 项目: masatake/ctags
static void parseMethod (tokenInfo *token, int owner)
{
	tokenRead (token);
	if (tokenIsType (token, TCL_IDENTIFIER))
	{
		tagEntryInfo e;

		initTagEntry(&e, vStringValue (token->string), K_METHOD);
		e.extensionFields.scopeIndex = owner;
		makeTagEntry (&e);
	}
	skipToEndOfTclCmdline (token);
}
示例#3
0
文件: tcloo.c 项目: masatake/ctags
static void parseSuperclass (tokenInfo *token, int this_class)
{
	tokenRead (token);
	if (tokenIsType (token, TCL_IDENTIFIER))
	{
		tagEntryInfo *e = getEntryInCorkQueue(this_class);

		if (e)
		{
			if (e->extensionFields.inheritance)
			{   /* superclass is used twice in a class. */
				eFree ((void *)e->extensionFields.inheritance);
			}
			e->extensionFields.inheritance = eStrdup(tokenString(token));
		}
	}
	skipToEndOfTclCmdline (token);
}
示例#4
0
bool tokenIsKeyword  (tokenInfo *token, tokenKeyword k)
{
	return (tokenIsType (token, token->klass->typeForKeyword)
			&& token->keyword == k)? true: false;
}