Update Scintilla from 3.4.3 to 3.4.4

This commit is contained in:
ARATA Mizuki
2015-01-10 20:19:40 +09:00
committed by Vadim Zeitlin
parent 40fa003072
commit 7ebb51a895
60 changed files with 423 additions and 459 deletions

View File

@@ -6,6 +6,12 @@
** The License.txt file describes the conditions under which this software may be distributed.
**/
// Previous releases of this lexer included support for marking token starts with
// a style byte indicator. This was used by the wxGhostscript IDE/debugger.
// Style byte indicators were removed in version 3.4.3.
// Anyone wanting to restore this functionality for wxGhostscript using 'modern'
// indicators can examine the earlier source in the Mercurial repository.
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -72,7 +78,6 @@ static void ColourisePSDoc(
StyleContext sc(startPos, length, initStyle, styler);
bool tokenizing = styler.GetPropertyInt("ps.tokenize") != 0;
int pslevel = styler.GetPropertyInt("ps.level", 3);
int lineCurrent = styler.GetLine(startPos);
int nestTextCurrent = 0;
@@ -83,15 +88,6 @@ static void ColourisePSDoc(
bool numHasExponent = false;
bool numHasSign = false;
// Clear out existing tokenization
if (tokenizing && length > 0) {
styler.StartAt(startPos, static_cast<char>(INDIC2_MASK));
styler.ColourTo(startPos + length-1, 0);
styler.Flush();
styler.StartAt(startPos);
styler.StartSegment(startPos);
}
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart)
lineCurrent = styler.GetLine(sc.currentPos);
@@ -196,7 +192,6 @@ static void ColourisePSDoc(
// Determine if a new state should be entered.
if (sc.state == SCE_C_DEFAULT) {
unsigned int tokenpos = sc.currentPos;
if (sc.ch == '[' || sc.ch == ']') {
sc.SetState(SCE_PS_PAREN_ARRAY);
@@ -262,17 +257,6 @@ static void ColourisePSDoc(
} else if (!IsAWhitespaceChar(sc.ch)) {
sc.SetState(SCE_PS_NAME);
}
// Mark the start of tokens
if (tokenizing && sc.state != SCE_C_DEFAULT && sc.state != SCE_PS_COMMENT &&
sc.state != SCE_PS_DSC_COMMENT && sc.state != SCE_PS_DSC_VALUE) {
styler.Flush();
styler.StartAt(tokenpos, static_cast<char>(INDIC2_MASK));
styler.ColourTo(tokenpos, INDIC2_MASK);
styler.Flush();
styler.StartAt(tokenpos);
styler.StartSegment(tokenpos);
}
}
if (sc.atLineEnd)
@@ -296,11 +280,10 @@ static void FoldPSDoc(unsigned int startPos, int length, int, WordList *[],
int levelNext = levelCurrent;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
int style;
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
style = styleNext;
int style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); //mac??
if ((style & 31) == SCE_PS_PAREN_PROC) {