测试1

//优先处理注释或字符串
BOOL HandleCommentAndString(LPLANGUAGEINFO pLang, LPTSTR pCh, LPTSTR *ppNextToken, LPBOOL pbLineHead,
	BOOL bLineNumber, BOOL bLineNumberBk, int nWidth, LPINT pLineNo)
{
	//TCHAR chEndString;
	if(_tcsncmp(pCh, pLang->lineComment, _tcslen(pLang->lineComment)) == 0)
	{
		*ppNextToken = HandleLineComment(pCh);
		*pbLineHead = TRUE;
		return TRUE;
	}

	//开启块注释?
	if(_tcsncmp(pCh, pLang->blockCommentOn, _tcslen(pLang->blockCommentOn)) == 0)
	{
		*ppNextToken = HandleBlockComment(pLang, pCh, bLineNumber, bLineNumberBk, nWidth, pLineNo);
		*pbLineHead = FALSE;
		return TRUE;
	}

	//字符串的起始标记不能配置<,因为这会和小于号冲突!
	//处理字符串
	if(*pCh && _tcschr(pLang->stringChars, *pCh) != NULL)
	{
		//if(*pCh == _T('<'))
		//	chEndString = _T('>');
		//else
		//	chEndString = *pCh;
		*ppNextToken = HandleString(pLang, pCh, *pCh);
		*pbLineHead = FALSE;
		return TRUE;
	}
	return FALSE;
}

你可能感兴趣的:(测试1)