diff options
| author | nyamatongwe <unknown> | 2000-07-06 14:17:37 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2000-07-06 14:17:37 +0000 | 
| commit | 7a086660c2a2564ecbed98364341c36bf6194be4 (patch) | |
| tree | 529937ee1f3961bfa7bdd9200adcd1541f6974ee /src/LexCPP.cxx | |
| parent | 2ba517d3b3dfa5fe0d3c7a5f268c07294a1e7223 (diff) | |
| download | scintilla-mirror-7a086660c2a2564ecbed98364341c36bf6194be4.tar.gz | |
Optimisations.
Diffstat (limited to 'src/LexCPP.cxx')
| -rw-r--r-- | src/LexCPP.cxx | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index 8e3b7c498..b77468a44 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -19,14 +19,13 @@  static bool classifyWordCpp(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {  	char s[100]; -	bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.'); -	bool wordIsUUID = false;  	for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {  		s[i] = styler[start + i];  		s[i + 1] = '\0';  	} +	bool wordIsUUID = false;  	char chAttr = SCE_C_IDENTIFIER; -	if (wordIsNumber) +	if (isdigit(s[0]) || (s[0] == '.'))  		chAttr = SCE_C_NUMBER;  	else {  		if (keywords.InList(s)) { @@ -99,7 +98,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo  					state = SCE_C_UUID;  					lastWordWasUUID = false;  				} else { -					state = SCE_C_WORD; +					state = SCE_C_IDENTIFIER;  				}  			} else if (ch == '/' && chNext == '*') {  				styler.ColourTo(i-1, state); @@ -132,7 +131,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo  					levelCurrent += (ch == '{') ? 1 : -1;  				}  			} -		} else if (state == SCE_C_WORD) { +		} else if (state == SCE_C_IDENTIFIER) {  			if (!iswordchar(ch)) {  				lastWordWasUUID = classifyWordCpp(styler.GetStartSegment(), i - 1, keywords, styler);  				state = SCE_C_DEFAULT; | 
