diff options
author | Neil <nyamatongwe@gmail.com> | 2014-05-31 09:27:48 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-05-31 09:27:48 +1000 |
commit | 9bc61b338dfe63d2e6fcc66bc0933a0de6bcd31b (patch) | |
tree | 64c541e9dcb42c9999759ab7dd40d67c72749b9a /lexers/LexPS.cxx | |
parent | 8326c658b392ba13e92918dd89deebd60bcd195f (diff) | |
parent | 8b447b76bbc110e055a0637657f5f00c65cc98dd (diff) | |
download | scintilla-mirror-9bc61b338dfe63d2e6fcc66bc0933a0de6bcd31b.tar.gz |
Merge 343-Win32-Fix which fixes hangs and crashes at shutdown on Windows.
Diffstat (limited to 'lexers/LexPS.cxx')
-rw-r--r-- | lexers/LexPS.cxx | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/lexers/LexPS.cxx b/lexers/LexPS.cxx index 3661c4b66..2c8917dae 100644 --- a/lexers/LexPS.cxx +++ b/lexers/LexPS.cxx @@ -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) { |