diff options
| author | nyamatongwe <devnull@localhost> | 2003-09-08 12:03:21 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2003-09-08 12:03:21 +0000 | 
| commit | 3e6d35beadd3985e565c0200c832b795b6ea6a26 (patch) | |
| tree | e692a436c30d3eed7613c2771a496974dcf91fca /src/LexPOV.cxx | |
| parent | 6d29b5d35e04a8346d2f878f743b874406778715 (diff) | |
| download | scintilla-mirror-3e6d35beadd3985e565c0200c832b795b6ea6a26.tar.gz | |
Patch from Philippe to patch restrict local function visibility and improve code.
Diffstat (limited to 'src/LexPOV.cxx')
| -rw-r--r-- | src/LexPOV.cxx | 17 | 
1 files changed, 11 insertions, 6 deletions
| diff --git a/src/LexPOV.cxx b/src/LexPOV.cxx index 33ba6a490..0c1a21ab4 100644 --- a/src/LexPOV.cxx +++ b/src/LexPOV.cxx @@ -33,10 +33,18 @@ static inline bool IsAWordChar(const int ch) {  	return ch < 0x80 && (isalnum(ch) || ch == '_');  } -inline bool IsAWordStart(const int ch) { +static inline bool IsAWordStart(const int ch) {  	return ch < 0x80 && isalpha(ch);  } +static inline bool IsANumberChar(const int ch) { +	// Not exactly following number definition (several dots are seen as OK, etc.) +	// but probably enough in most cases. +	return (ch < 0x80) && +	        (isdigit(ch) || toupper(ch) == 'E' || +             ch == '.' || ch == '-' || ch == '+'); +} +  static void ColourisePovDoc(  	unsigned int startPos,  	int length, @@ -91,11 +99,8 @@ static void ColourisePovDoc(  			sc.SetState(SCE_POV_DEFAULT);  		} else if (sc.state == SCE_POV_NUMBER) {  			// We stop the number definition on non-numerical non-dot non-eE non-sign char -			if (!(isdigit(sc.ch) || sc.ch == '.' || -				  toupper(sc.ch) == 'E' || sc.ch == '-' || sc.ch == '+')) { -					// Not exactly following number definition (several dots are seen as OK, etc.) -					// but probably enough in most cases. -					sc.SetState(SCE_POV_DEFAULT); +			if (!IsANumberChar(sc.ch)) { +				sc.SetState(SCE_POV_DEFAULT);  			}  		} else if (sc.state == SCE_POV_IDENTIFIER) {  			if (!IsAWordChar(sc.ch)) { | 
