diff options
| author | nyamatongwe <unknown> | 2001-01-04 05:43:53 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2001-01-04 05:43:53 +0000 | 
| commit | a36562e7deb80b15cb477d2bc1255739b8b48b6c (patch) | |
| tree | 5fec4bd7b67fad31bbdbe15242dd00a66666f37d | |
| parent | 32bf7947ecc3cdfc698dfad366e59ceb1407cc1b (diff) | |
| download | scintilla-mirror-a36562e7deb80b15cb477d2bc1255739b8b48b6c.tar.gz | |
Reformatted.
| -rw-r--r-- | src/LexHTML.cxx | 59 | 
1 files changed, 28 insertions, 31 deletions
| diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index 92195f00d..86f4e8ff0 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -3,11 +3,11 @@  // Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>  // The License.txt file describes the conditions under which this software may be distributed. -#include <stdlib.h>  -#include <string.h>  -#include <ctype.h>  -#include <stdio.h>  -#include <stdarg.h>  +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h>  #include "Platform.h" @@ -117,7 +117,7 @@ static int stateForPrintState(int StateToPrint) {  static inline bool IsNumber(unsigned int start, Accessor &styler) {  	return isdigit(styler[start]) || (styler[start] == '.') || -	                    (styler[start] == '-') || (styler[start] == '#'); +	       (styler[start] == '-') || (styler[start] == '#');  }  static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { @@ -370,31 +370,32 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			case eScriptJS:  			case eScriptPHP:  				//not currently supported				case eScriptVBS: +  				if ((state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (state != SCE_HJ_COMMENT) && (state != SCE_HJ_COMMENTLINE) && (state != SCE_HJ_COMMENTDOC)) { -				if ((ch == '{') || (ch == '}')) { -					levelCurrent += (ch == '{') ? 1 : -1; +					if ((ch == '{') || (ch == '}')) { +						levelCurrent += (ch == '{') ? 1 : -1;  					}  				}  				break;  			case eScriptPython:  				if (state != SCE_HP_COMMENTLINE) { -				if ((ch == ':') && ((chNext == '\n') || (chNext == '\r' && chNext2 == '\n'))) { -					levelCurrent++; -				} else if ((ch == '\n') && !((chNext == '\r') && (chNext2 == '\n')) && (chNext != '\n')) { -					// check if the number of tabs is lower than the level -					int Findlevel = (levelCurrent & ~SC_FOLDLEVELBASE) * 8; -					for (int j = 0;Findlevel > 0;j++) { -						char chTmp = styler.SafeGetCharAt(i + j + 1); -						if (chTmp == '\t') { -							Findlevel -= 8; -						}	else if (chTmp == ' ') { -							Findlevel--; -						}	else break; -					} +					if ((ch == ':') && ((chNext == '\n') || (chNext == '\r' && chNext2 == '\n'))) { +						levelCurrent++; +					} else if ((ch == '\n') && !((chNext == '\r') && (chNext2 == '\n')) && (chNext != '\n')) { +						// check if the number of tabs is lower than the level +						int Findlevel = (levelCurrent & ~SC_FOLDLEVELBASE) * 8; +						for (int j = 0;Findlevel > 0;j++) { +							char chTmp = styler.SafeGetCharAt(i + j + 1); +							if (chTmp == '\t') { +								Findlevel -= 8; +							}	else if (chTmp == ' ') { +								Findlevel--; +							}	else break; +						} -					if (Findlevel > 0) { -						levelCurrent -= Findlevel / 8; -						if (Findlevel % 8) levelCurrent--; +						if (Findlevel > 0) { +							levelCurrent -= Findlevel / 8; +							if (Findlevel % 8) levelCurrent--;  						}  					}  				} @@ -490,12 +491,10 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			} else {  				if (chNext2 == '=') {  					i += 2; // place as if it was the second next char treated -				} -				else { +				} else {  					i++; // place as if it was the next char treated  				} -  				state = StateForScript(defaultScript);  			}  			styler.ColourTo(i, SCE_H_ASP); @@ -1077,8 +1076,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			break;  		case SCE_HPHP_HSTRING:  			if (ch == '\\') { -        // skip the next char -					i++; +				// skip the next char +				i++;  			} else if (ch == '\"') {  				styler.ColourTo(i, StateToPrint);  				state = SCE_HPHP_DEFAULT; @@ -1118,8 +1117,6 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			///////////// end - PHP state handling  		} - -  		if (state == SCE_HB_DEFAULT) {    // One of the above succeeded  			if (ch == '\"') {  				state = SCE_HB_STRING; | 
