diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/LexHTML.cxx | 23 | 
1 files changed, 20 insertions, 3 deletions
| diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index d830a4643..95b78476b 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -149,7 +149,13 @@ static inline bool isStringState(int state) {  	case SCE_HB_STRING:  	case SCE_HBA_STRING:  	case SCE_HP_STRING: +	case SCE_HP_CHARACTER: +	case SCE_HP_TRIPLE: +	case SCE_HP_TRIPLEDOUBLE:  	case SCE_HPA_STRING: +	case SCE_HPA_CHARACTER: +	case SCE_HPA_TRIPLE: +	case SCE_HPA_TRIPLEDOUBLE:  	case SCE_HPHP_HSTRING:  	case SCE_HPHP_SIMPLESTRING:  	case SCE_HPHP_HSTRING_VARIABLE: @@ -163,6 +169,19 @@ static inline bool isStringState(int state) {  	return bResult;  } +static inline bool stateAllowsTermination(int state) { +	bool allowTermination = !isStringState(state); +	if (allowTermination) { +		switch (state) { +		case SCE_HPHP_COMMENT: +		case SCE_HP_COMMENTLINE: +		case SCE_HPA_COMMENTLINE: +			allowTermination = false; +		} +	} +	return allowTermination; +} +  // not really well done, since it's only comments that should lex the %> and <%  static inline bool isCommentASPState(int state) {  	bool bResult; @@ -763,9 +782,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  		else if ((  		             ((inScriptType == eNonHtmlPreProc)  		              || (inScriptType == eNonHtmlScriptPreProc)) && ( -		                 ((scriptLanguage == eScriptPHP) && (ch == '?') && !isPHPStringState(state) && (state != SCE_HPHP_COMMENT)) || -		                 ((scriptLanguage != eScriptNone) && !isStringState(state) && -		                  ((ch == '%') || (ch == '?'))) +		                 ((scriptLanguage != eScriptNone) && stateAllowsTermination(state) && ((ch == '%') || (ch == '?')))  		             ) && (chNext == '>')) ||  		         ((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) {  			if (state == SCE_H_ASPAT) { | 
