aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers
diff options
context:
space:
mode:
Diffstat (limited to 'lexers')
-rw-r--r--lexers/LexCPP.cxx16
-rw-r--r--lexers/LexDMIS.cxx6
-rw-r--r--lexers/LexECL.cxx2
-rw-r--r--lexers/LexEScript.cxx2
-rw-r--r--lexers/LexHTML.cxx11
-rw-r--r--lexers/LexHaskell.cxx2
-rw-r--r--lexers/LexMySQL.cxx2
-rw-r--r--lexers/LexPS.cxx31
-rw-r--r--lexers/LexPerl.cxx2
-rw-r--r--lexers/LexRuby.cxx5
-rw-r--r--lexers/LexRust.cxx2
-rw-r--r--lexers/LexScriptol.cxx32
-rw-r--r--lexers/LexSpecman.cxx2
-rw-r--r--lexers/LexVHDL.cxx2
-rw-r--r--lexers/LexVisualProlog.cxx2
15 files changed, 39 insertions, 80 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 7fe680991..b8b48aa52 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -8,10 +8,10 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
+#include <ctype.h>
#include <string>
#include <vector>
@@ -821,10 +821,18 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) ||
((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8'));
if (valid) {
- if (literalString)
- sc.ChangeState((raw ? SCE_C_STRINGRAW : SCE_C_STRING)|activitySet);
- else
+ if (literalString) {
+ if (raw) {
+ // Set the style of the string prefix to SCE_C_STRINGRAW but then change to
+ // SCE_C_DEFAULT as that allows the raw string start code to run.
+ sc.ChangeState(SCE_C_STRINGRAW|activitySet);
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ sc.ChangeState(SCE_C_STRING|activitySet);
+ }
+ } else {
sc.ChangeState(SCE_C_CHARACTER|activitySet);
+ }
} else {
sc.SetState(SCE_C_DEFAULT | activitySet);
}
diff --git a/lexers/LexDMIS.cxx b/lexers/LexDMIS.cxx
index 7f23ba96b..a903e9da6 100644
--- a/lexers/LexDMIS.cxx
+++ b/lexers/LexDMIS.cxx
@@ -13,14 +13,14 @@
#include <cctype>
#include "ILexer.h"
-#include "SciLexer.h"
#include "Scintilla.h"
+#include "SciLexer.h"
-#include "LexerModule.h"
+#include "WordList.h"
#include "LexAccessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
-#include "WordList.h"
+#include "LexerModule.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
diff --git a/lexers/LexECL.cxx b/lexers/LexECL.cxx
index 6a08d58c2..d8065f722 100644
--- a/lexers/LexECL.cxx
+++ b/lexers/LexECL.cxx
@@ -7,10 +7,10 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
+#include <ctype.h>
#ifdef _MSC_VER
#pragma warning(disable: 4786)
diff --git a/lexers/LexEScript.cxx b/lexers/LexEScript.cxx
index 9a7560e1e..28466bc8e 100644
--- a/lexers/LexEScript.cxx
+++ b/lexers/LexEScript.cxx
@@ -6,10 +6,10 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
+#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx
index f5da934d2..d6b0b31bc 100644
--- a/lexers/LexHTML.cxx
+++ b/lexers/LexHTML.cxx
@@ -576,8 +576,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords
- // Lexer for HTML requires more lexical states (8 bits worth) than most lexers
- styler.StartAt(startPos, static_cast<unsigned char>(STYLE_MAX));
+ styler.StartAt(startPos);
char prevWord[200];
prevWord[0] = '\0';
char phpStringDelimiter[200]; // PHP is not limited in length, we are
@@ -609,7 +608,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
if (startPos == 0)
state = SCE_H_DEFAULT;
}
- styler.StartAt(startPos, static_cast<unsigned char>(STYLE_MAX));
+ styler.StartAt(startPos);
int lineCurrent = styler.GetLine(startPos);
int lineState;
@@ -2180,6 +2179,6 @@ static const char * const phpscriptWordListDesc[] = {
0,
};
-LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8);
-LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8);
-LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8);
+LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc);
+LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc);
+LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc);
diff --git a/lexers/LexHaskell.cxx b/lexers/LexHaskell.cxx
index e10cb8c81..24355fa4e 100644
--- a/lexers/LexHaskell.cxx
+++ b/lexers/LexHaskell.cxx
@@ -38,9 +38,9 @@
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
+#include "CharacterCategory.h"
#include "LexerModule.h"
#include "OptionSet.h"
-#include "CharacterCategory.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
diff --git a/lexers/LexMySQL.cxx b/lexers/LexMySQL.cxx
index d3e0033b0..b873ccda1 100644
--- a/lexers/LexMySQL.cxx
+++ b/lexers/LexMySQL.cxx
@@ -570,4 +570,4 @@ static const char * const mysqlWordListDesc[] = {
0
};
-LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc, 7);
+LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc);
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) {
diff --git a/lexers/LexPerl.cxx b/lexers/LexPerl.cxx
index 8fa516b34..b4a2dd12e 100644
--- a/lexers/LexPerl.cxx
+++ b/lexers/LexPerl.cxx
@@ -1726,4 +1726,4 @@ void SCI_METHOD LexerPerl::Fold(unsigned int startPos, int length, int /* initSt
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
-LexerModule lmPerl(SCLEX_PERL, LexerPerl::LexerFactoryPerl, "perl", perlWordListDesc, 8);
+LexerModule lmPerl(SCLEX_PERL, LexerPerl::LexerFactoryPerl, "perl", perlWordListDesc);
diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx
index e19a5147e..f818d3d47 100644
--- a/lexers/LexRuby.cxx
+++ b/lexers/LexRuby.cxx
@@ -705,8 +705,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle,
char chPrev = styler.SafeGetCharAt(startPos - 1);
char chNext = styler.SafeGetCharAt(startPos);
bool is_real_number = true; // Differentiate between constants and ?-sequences.
- // Ruby uses a different mask because bad indentation is marked by oring with 32
- styler.StartAt(startPos, 127);
+ styler.StartAt(startPos);
styler.StartSegment(startPos);
static int q_states[] = {SCE_RB_STRING_Q,
@@ -1776,4 +1775,4 @@ static const char * const rubyWordListDesc[] = {
0
};
-LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc, 6);
+LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc);
diff --git a/lexers/LexRust.cxx b/lexers/LexRust.cxx
index bf59933af..8a3020532 100644
--- a/lexers/LexRust.cxx
+++ b/lexers/LexRust.cxx
@@ -21,6 +21,7 @@
#include "Scintilla.h"
#include "SciLexer.h"
+#include "PropSetSimple.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
@@ -28,7 +29,6 @@
#include "CharacterSet.h"
#include "LexerModule.h"
#include "OptionSet.h"
-#include "PropSetSimple.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
diff --git a/lexers/LexScriptol.cxx b/lexers/LexScriptol.cxx
index 31747b88e..40ef0de58 100644
--- a/lexers/LexScriptol.cxx
+++ b/lexers/LexScriptol.cxx
@@ -127,11 +127,10 @@ static void ColouriseSolDoc(unsigned int startPos, int length, int initStyle,
}
}
- styler.StartAt(startPos, 127);
+ styler.StartAt(startPos);
WordList &keywords = *keywordlists[0];
- int whingeLevel = styler.GetPropertyInt("tab.timmy.whinge.level");
char prevWord[200];
prevWord[0] = '\0';
if (length == 0) return;
@@ -143,37 +142,9 @@ static void ColouriseSolDoc(unsigned int startPos, int length, int initStyle,
char chPrev2 = ' ';
char chNext = styler[startPos];
styler.StartSegment(startPos);
- bool atStartLine = true;
- int spaceFlags = 0;
for (int i = startPos; i < lengthDoc; i++)
{
- if (atStartLine)
- {
- char chBad = static_cast<char>(64);
- char chGood = static_cast<char>(0);
- char chFlags = chGood;
-
- if (whingeLevel == 1)
- {
- chFlags = (spaceFlags & wsInconsistent) ? chBad : chGood;
- }
- else if (whingeLevel == 2)
- {
- chFlags = (spaceFlags & wsSpaceTab) ? chBad : chGood;
- }
- else if (whingeLevel == 3)
- {
- chFlags = (spaceFlags & wsSpace) ? chBad : chGood;
- }
- else if (whingeLevel == 4)
- {
- chFlags = (spaceFlags & wsTab) ? chBad : chGood;
- }
- styler.SetFlags(chFlags, static_cast<char>(state));
- atStartLine = false;
- }
-
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
@@ -185,7 +156,6 @@ static void ColouriseSolDoc(unsigned int startPos, int length, int initStyle,
{
styler.ColourTo(i, state);
}
- atStartLine = true;
}
if (styler.IsLeadByte(ch))
diff --git a/lexers/LexSpecman.cxx b/lexers/LexSpecman.cxx
index 1b96482ea..918edaf98 100644
--- a/lexers/LexSpecman.cxx
+++ b/lexers/LexSpecman.cxx
@@ -8,10 +8,10 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
+#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
diff --git a/lexers/LexVHDL.cxx b/lexers/LexVHDL.cxx
index 88d8efb27..189416425 100644
--- a/lexers/LexVHDL.cxx
+++ b/lexers/LexVHDL.cxx
@@ -12,10 +12,10 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
+#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
diff --git a/lexers/LexVisualProlog.cxx b/lexers/LexVisualProlog.cxx
index 0acdb26a1..24e19e24e 100644
--- a/lexers/LexVisualProlog.cxx
+++ b/lexers/LexVisualProlog.cxx
@@ -13,10 +13,10 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
+#include <ctype.h>
#ifdef _MSC_VER
#pragma warning(disable: 4786)