aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-05-02 22:47:15 +0000
committernyamatongwe <devnull@localhost>2010-05-02 22:47:15 +0000
commita0e66715813ecda7a61e512c11349cd1d3df01b2 (patch)
tree89ebf66887df764fba312a0e610344457a57e98f /src
parentcd6d44de2ad5b93909c50db3cf467821db392f75 (diff)
downloadscintilla-mirror-a0e66715813ecda7a61e512c11349cd1d3df01b2.tar.gz
Simplest changes from Feature Request #2992689 Lexer for xBase dialects.
Removes unused lexical states. Removes treament of "'" as comment indicator for folding.
Diffstat (limited to 'src')
-rw-r--r--src/LexFlagship.cxx29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/LexFlagship.cxx b/src/LexFlagship.cxx
index baf2941a8..ec0e44c07 100644
--- a/src/LexFlagship.cxx
+++ b/src/LexFlagship.cxx
@@ -1,6 +1,6 @@
// Scintilla source code edit control
/** @file LexFlagShip.cxx
- ** Lexer for FlagShip
+ ** Lexer for FlagShip
** (Syntactically compatible to other XBase dialects, like dBase, Clipper, Fox etc.)
**/
// Copyright 2005 by Randy Butler
@@ -26,10 +26,6 @@
using namespace Scintilla;
#endif
-static bool IsFlagShipComment(Accessor &styler, int pos, int len) {
- return len>0 && styler[pos]=='\'';
-}
-
static inline bool IsTypeCharacter(int ch) {
return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$';
}
@@ -54,7 +50,6 @@ static inline bool IsADateCharacter(const int ch) {
static void ColouriseFlagShipDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
- //bool FSScriptSyntax = true;
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
@@ -179,30 +174,26 @@ static void FoldFlagShipDoc(unsigned int startPos, int length, int,
// Backtrack to previous line in case need to fix its fold status
int lineCurrent = styler.GetLine(startPos);
- if (startPos > 0) {
- if (lineCurrent > 0) {
- lineCurrent--;
- startPos = styler.LineStart(lineCurrent);
- }
+ if (startPos > 0 && lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
}
int spaceFlags = 0;
- int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsFlagShipComment);
+ int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags);
char chNext = styler[startPos];
for (int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
- if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) {
+ if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos-1)) {
int lev = indentCurrent;
- int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsFlagShipComment);
+ int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags);
if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
- // Only non whitespace lines can be headers
if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) {
lev |= SC_FOLDLEVELHEADERFLAG;
} else if (indentNext & SC_FOLDLEVELWHITEFLAG) {
- // Line after is blank so check the next - maybe should continue further?
int spaceFlags2 = 0;
- int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsFlagShipComment);
+ int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2);
if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) {
lev |= SC_FOLDLEVELHEADERFLAG;
}
@@ -215,7 +206,6 @@ static void FoldFlagShipDoc(unsigned int startPos, int length, int,
}
}
-
static const char * const FSWordListDesc[] = {
"Keywords",
"functions",
@@ -225,6 +215,3 @@ static const char * const FSWordListDesc[] = {
};
LexerModule lmFlagShip(SCLEX_FLAGSHIP, ColouriseFlagShipDoc, "flagship", FoldFlagShipDoc, FSWordListDesc);
-
-
-