diff options
| author | nyamatongwe <devnull@localhost> | 2000-12-19 01:21:19 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2000-12-19 01:21:19 +0000 | 
| commit | 13e6f5a8a457c42b6e319e30718ebc784f4b5d4a (patch) | |
| tree | b913606f6813a28728a52dd0d156baa787355ed3 /src/LexPerl.cxx | |
| parent | 5341ae0c567eaca1c4cd888eb66e8e09247e9632 (diff) | |
| download | scintilla-mirror-13e6f5a8a457c42b6e319e30718ebc784f4b5d4a.tar.gz | |
Perl updated.
If property line has no '=' it is treated as '=1'.
Diffstat (limited to 'src/LexPerl.cxx')
| -rw-r--r-- | src/LexPerl.cxx | 25 | 
1 files changed, 16 insertions, 9 deletions
| diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx index 9956c8fb2..f63816d8b 100644 --- a/src/LexPerl.cxx +++ b/src/LexPerl.cxx @@ -128,8 +128,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,  		startPos = styler.LineStart(styler.GetLine(startPos));  		state = styler.StyleAt(startPos - 1);  	} -	if (state == SCE_PL_REGEX || -		state == SCE_PL_REGSUBST || state == SCE_PL_LONGQUOTE) { +	if (state == SCE_PL_REGEX || state == SCE_PL_REGSUBST +		|| state == SCE_PL_LONGQUOTE || state == SCE_PL_STRING_Q) {  		while ((startPos > 1) && (styler.StyleAt(startPos - 1) == state)) {  			startPos--;  		} @@ -138,6 +138,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,  	styler.StartAt(startPos);  	char chPrev = styler.SafeGetCharAt(startPos - 1); +	if (startPos == 0) +		chPrev = '\n';  	char chNext = styler[startPos];  	styler.StartSegment(startPos); @@ -195,6 +197,12 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,  					quoteUp = '\0';  					quoteDown = '\0';  					quoteRep = 1; +				} else if (ch == 'q' && !isalnum(chNext)) { +					state = SCE_PL_STRING_Q; +					quotes = 0; +					quoteUp = '\0'; +					quoteDown = '\0'; +					quoteRep = 1;  				} else if (ch == 't' && chNext == 'r' && !isalnum(chNext2)) {  					state = SCE_PL_REGSUBST;  					quotes = 0; @@ -262,13 +270,9 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,  				styler.ColourTo(i - 1, state);  				if (isalpha(chNext) || chNext == '#' || chNext == '$' || chNext == '_') {  					state = SCE_PL_HASH; -				// } else if (chNext != '{' && chNext != '[') {  				} else if (chNext == '{') {  					styler.ColourTo(i, SCE_PL_HASH); -					// i++; -					// ch = ' ';  				} else { -					// styler.ColourTo(i, SCE_PL_HASH);  					styler.ColourTo(i, SCE_PL_OPERATOR);  				}  			} else if (ch == '*') { @@ -287,7 +291,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,  				HereDoc.State = 0;  			} else if (ch == '='  				&& isalpha(chNext) -				&& ((startPos == 0) || isEOLChar(chPrev))) { +				&& (isEOLChar(chPrev))) {  				styler.ColourTo(i - 1, state);  				state = SCE_PL_POD;  				quotes = 0; @@ -302,7 +306,10 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,  				styler.ColourTo(i, SCE_PL_OPERATOR);  			}  		} else if (state == SCE_PL_WORD) { -			if (!iswordchar(ch) && ch != '\'') {	// Archaic Perl has quotes inside names +			if ((!iswordchar(ch) && ch != '\'') +				|| (ch == '.' && chNext == '.')) { +				// ".." is always an operator if preceded by a SCE_PL_WORD. +				// Archaic Perl has quotes inside names  				if (isMatch(styler, lengthDoc, styler.GetStartSegment(), "__DATA__")) {  					styler.ColourTo(i, SCE_PL_DATASECTION);  					state = SCE_PL_DATASECTION; @@ -595,7 +602,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,  						}  					}  				} -			} else if (state == SCE_PL_LONGQUOTE) { +			} else if (state == SCE_PL_LONGQUOTE || state == SCE_PL_STRING_Q) {  				if (!quoteDown && !isspace(ch)) {  					quoteUp = ch;  					quoteDown = opposite(quoteUp); | 
