diff options
Diffstat (limited to 'src/LexVB.cxx')
| -rw-r--r-- | src/LexVB.cxx | 43 | 
1 files changed, 43 insertions, 0 deletions
| diff --git a/src/LexVB.cxx b/src/LexVB.cxx index acc3b0d54..cdda470b5 100644 --- a/src/LexVB.cxx +++ b/src/LexVB.cxx @@ -20,20 +20,37 @@  static int classifyWordVB(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) {  	char s[100]; +#ifdef OLD /* PL 2000/05/18 -- Include hexadecimal number */  	bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.'); +#else  /* OLD PL 2000/05/18 */ +	bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.') || +		(styler[start] == '&' && tolower(styler[start+1]) == 'h'); +#endif /* OLD PL 2000/05/18 */  	for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) {  		s[i] = static_cast<char>(tolower(styler[start + i])); +#ifdef OLD /* PL 2000/05/18 -- Little optimization */  		s[i + 1] = '\0';  	} +#else  /* OLD PL 2000/05/18 */ +	} +	s[i] = '\0'; +#endif /* OLD PL 2000/05/18 */  	char chAttr = SCE_C_DEFAULT;  	if (wordIsNumber)  		chAttr = SCE_C_NUMBER;  	else { +#ifdef OLD /* PL 2000/05/18 */  		if (keywords.InList(s)) {  			chAttr = SCE_C_WORD;  			if (strcmp(s, "rem") == 0)  				chAttr = SCE_C_COMMENTLINE;  		} +#else  /* OLD PL 2000/05/18 */ +		if (strcmp(s, "rem") == 0) +			chAttr = SCE_C_COMMENTLINE; +		else if (keywords.InList(s)) +			chAttr = SCE_C_WORD; +#endif /* OLD PL 2000/05/18 */  	}  	styler.ColourTo(end, chAttr);  	if (chAttr == SCE_C_COMMENTLINE) @@ -73,6 +90,18 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,  			} else if (ch == '\"') {  				styler.ColourTo(i - 1, state);  				state = SCE_C_STRING; +#ifdef OLD /* PL 2000/05/18 */ +#else  /* OLD PL 2000/05/18 */ +			} else if (ch == '#') { +				styler.ColourTo(i - 1, state); +				state = SCE_C_PREPROCESSOR; +			} else if (ch == '&' && tolower(chNext) == 'h') { +				styler.ColourTo(i - 1, state); +				state = SCE_C_WORD; +			} else if (isoperator(ch)) { +				styler.ColourTo(i - 1, state); +				styler.ColourTo(i, SCE_C_OPERATOR); +#endif /* OLD PL 2000/05/18 */  			}  		} else if (state == SCE_C_WORD) {  			if (!iswordchar(ch)) { @@ -82,6 +111,12 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,  						state = SCE_C_COMMENTLINE;  					} else if (ch == '\"') {  						state = SCE_C_STRING; +#ifdef OLD /* PL 2000/05/18 */ +#else  /* OLD PL 2000/05/18 */ +					} else if (isoperator(ch)) { +						styler.ColourTo(i - 1, state); +						styler.ColourTo(i, SCE_C_OPERATOR); +#endif /* OLD PL 2000/05/18 */  					}  				}  			} @@ -100,6 +135,14 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,  					ch = chNext;  					chNext = styler.SafeGetCharAt(i + 1);  				} +#ifdef OLD /* PL 2000/05/18 */ +#else  /* OLD PL 2000/05/18 */ +			} else if (state == SCE_C_PREPROCESSOR) { +				if (ch == '\r' || ch == '\n') { +					styler.ColourTo(i - 1, state); +					state = SCE_C_DEFAULT; +				} +#endif /* OLD PL 2000/05/18 */  			}  			if (state == SCE_C_DEFAULT) {    // One of the above succeeded  				if (ch == '\'') { | 
