diff options
author | nyamatongwe <unknown> | 2003-02-17 11:18:11 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-02-17 11:18:11 +0000 |
commit | bb028fe06a4e642aa20f72136c2deaf312ba61b9 (patch) | |
tree | 045f6c279f221341f136acd2d2cdd2e8db3a65f8 /src | |
parent | d9b3f2fe99e4bb7fb6649eee27382f25f20a4146 (diff) | |
download | scintilla-mirror-bb028fe06a4e642aa20f72136c2deaf312ba61b9.tar.gz |
Upgraded keyword list descriptions from Brian Quinlan.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexEiffel.cxx | 23 | ||||
-rw-r--r-- | src/LexLisp.cxx | 15 | ||||
-rw-r--r-- | src/LexLua.cxx | 12 | ||||
-rw-r--r-- | src/LexMatlab.cxx | 9 | ||||
-rw-r--r-- | src/LexOthers.cxx | 21 | ||||
-rw-r--r-- | src/LexPascal.cxx | 16 | ||||
-rw-r--r-- | src/LexPerl.cxx | 2 | ||||
-rw-r--r-- | src/LexPython.cxx | 22 | ||||
-rw-r--r-- | src/LexRuby.cxx | 11 | ||||
-rw-r--r-- | src/LexSQL.cxx | 7 | ||||
-rw-r--r-- | src/LexVB.cxx | 19 |
11 files changed, 106 insertions, 51 deletions
diff --git a/src/LexEiffel.cxx b/src/LexEiffel.cxx index a0bf26a5e..974efd9a7 100644 --- a/src/LexEiffel.cxx +++ b/src/LexEiffel.cxx @@ -28,7 +28,7 @@ static inline bool isEiffelOperator(unsigned int ch) { ch == '{' || ch == '}' || ch == '~' || ch == '[' || ch == ']' || ch == ';' || ch == '<' || ch == '>' || ch == ',' || - ch == '.' || ch == '^' || ch == '%' || ch == ':' || + ch == '.' || ch == '^' || ch == '%' || ch == ':' || ch == '!' || ch == '@' || ch == '?'; } @@ -187,19 +187,19 @@ static void FoldEiffelDocKeyWords(unsigned int startPos, int length, int /* init s[j] = '\0'; if ( - (strcmp(s, "check") == 0) || - (strcmp(s, "debug") == 0) || - (strcmp(s, "deferred") == 0) || - (strcmp(s, "do") == 0) || + (strcmp(s, "check") == 0) || + (strcmp(s, "debug") == 0) || + (strcmp(s, "deferred") == 0) || + (strcmp(s, "do") == 0) || (strcmp(s, "from") == 0) || (strcmp(s, "if") == 0) || - (strcmp(s, "inspect") == 0) || + (strcmp(s, "inspect") == 0) || (strcmp(s, "once") == 0) ) levelCurrent++; if (!lastDeferred && (strcmp(s, "class") == 0)) levelCurrent++; - if (strcmp(s, "end") == 0) + if (strcmp(s, "end") == 0) levelCurrent--; lastDeferred = strcmp(s, "deferred") == 0; } @@ -226,5 +226,10 @@ static void FoldEiffelDocKeyWords(unsigned int startPos, int length, int /* init styler.SetLevel(lineCurrent, levelPrev | flagsNext); } -LexerModule lmEiffel(SCLEX_EIFFEL, ColouriseEiffelDoc, "eiffel", FoldEiffelDocIndent); -LexerModule lmEiffelkw(SCLEX_EIFFELKW, ColouriseEiffelDoc, "eiffelkw", FoldEiffelDocKeyWords); +static const char * const eiffelWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmEiffel(SCLEX_EIFFEL, ColouriseEiffelDoc, "eiffel", FoldEiffelDocIndent, eiffelWordListDesc); +LexerModule lmEiffelkw(SCLEX_EIFFELKW, ColouriseEiffelDoc, "eiffelkw", FoldEiffelDocKeyWords, eiffelWordListDesc); diff --git a/src/LexLisp.cxx b/src/LexLisp.cxx index cb150ff76..9cd5433c8 100644 --- a/src/LexLisp.cxx +++ b/src/LexLisp.cxx @@ -98,7 +98,7 @@ static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, W if (isLispwordstart(ch)) { styler.ColourTo(i - 1, state); state = SCE_LISP_IDENTIFIER; - } + } else if (ch == ';') { styler.ColourTo(i - 1, state); state = SCE_LISP_COMMENT; @@ -107,7 +107,7 @@ static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, W styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_LISP_OPERATOR); } - + else if (ch == '\"') { state = SCE_LISP_STRING; } @@ -115,12 +115,12 @@ static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, W if (!isLispwordstart(ch)) { classifyWordLisp(styler.GetStartSegment(), i - 1, keywords, styler); state = SCE_LISP_DEFAULT; - } /*else*/ + } /*else*/ if (isLispoperator(ch) || ch=='\'') { styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_LISP_OPERATOR); } - + } else { if (state == SCE_LISP_COMMENT) { if (atEOL) { @@ -192,4 +192,9 @@ static void FoldLispDoc(unsigned int startPos, int length, int /* initStyle */, styler.SetLevel(lineCurrent, levelPrev | flagsNext); } -LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc); +static const char * const lispWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc, lispWordListDesc); diff --git a/src/LexLua.cxx b/src/LexLua.cxx index b7920ef20..159bc1585 100644 --- a/src/LexLua.cxx +++ b/src/LexLua.cxx @@ -297,4 +297,14 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W styler.SetLevel(lineCurrent, levelPrev | flagsNext); } -LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc, "lua", FoldLuaDoc); +static const char * const luaWordListDesc[] = { + "Keywords", + "Basic functions", + "String & math functions", + "I/O & system facilities", + "XXX", + "XXX", + 0 +}; + +LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc, "lua", FoldLuaDoc, luaWordListDesc); diff --git a/src/LexMatlab.cxx b/src/LexMatlab.cxx index f75d15c7a..5f4dff3b8 100644 --- a/src/LexMatlab.cxx +++ b/src/LexMatlab.cxx @@ -2,7 +2,7 @@ /** @file LexMatlab.cxx ** Lexer for Matlab. ** Written by José Fonseca - **/ + **/ // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> // The License.txt file describes the conditions under which this software may be distributed. @@ -165,4 +165,9 @@ static void FoldMatlabDoc(unsigned int startPos, int length, int, } } -LexerModule lmMatlab(SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc); +static const char * const matlabWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmMatlab(SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc, matlabWordListDesc); diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index be512abbd..27a6bf406 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -564,9 +564,18 @@ static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle, styler.ColourTo(lengthDoc, state); } -LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch"); -LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff"); -LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props"); -LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile"); -LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist"); -LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex"); +static const char * const batchWordListDesc[] = { + "Keywords", + 0 +}; + +static const char * const emptyWordListDesc[] = { + 0 +}; + +LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc); +LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", 0, emptyWordListDesc); +LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", 0, emptyWordListDesc); +LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc); +LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc); +LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc); diff --git a/src/LexPascal.cxx b/src/LexPascal.cxx index 37e5e995f..c3bea6773 100644 --- a/src/LexPascal.cxx +++ b/src/LexPascal.cxx @@ -34,7 +34,7 @@ static void getRange(unsigned int start, } static bool IsStreamCommentStyle(int style) { - return style == SCE_C_COMMENT || + return style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC || style == SCE_C_COMMENTDOCKEYWORD || style == SCE_C_COMMENTDOCKEYWORDERROR; @@ -50,7 +50,7 @@ static int classifyWordPascal(unsigned int start, unsigned int end, /*WordList & WordList& keywords = *keywordlists[0]; WordList& classwords = *keywordlists[1]; - + char s[100]; getRange(start, end, styler, s, sizeof(s)); @@ -119,7 +119,7 @@ static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, styler.StartSegment(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; - + chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { @@ -329,7 +329,7 @@ static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, Word levelPrev = levelCurrent; visibleChars = 0; } - + if (!isspacechar(ch)) visibleChars++; } @@ -339,4 +339,10 @@ static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, Word styler.SetLevel(lineCurrent, levelPrev | flagsNext); } -LexerModule lmPascal(SCLEX_PASCAL, ColourisePascalDoc, "pascal", FoldPascalDoc); +static const char * const pascalWordListDesc[] = { + "Keywords", + "Classwords", + 0 +}; + +LexerModule lmPascal(SCLEX_PASCAL, ColourisePascalDoc, "pascal", FoldPascalDoc, pascalWordListDesc); diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx index e3167871a..211c3b875 100644 --- a/src/LexPerl.cxx +++ b/src/LexPerl.cxx @@ -715,7 +715,7 @@ static void FoldPerlDoc(unsigned int startPos, int length, int, WordList *[], } static const char * const perlWordListDesc[] = { - "Perl keywords", + "Keywords", 0 }; diff --git a/src/LexPython.cxx b/src/LexPython.cxx index a14570a6a..47974d1bc 100644 --- a/src/LexPython.cxx +++ b/src/LexPython.cxx @@ -373,39 +373,39 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse lev = lev + 1; } - // Skip past any blank lines for next indent level info; we skip also + // Skip past any blank lines for next indent level info; we skip also // comments (all comments, not just those starting in column 0) // which effectively folds them into surrounding code rather // than screwing up folding. - + while (!quote && (lineNext < docLines) && ((indentNext & SC_FOLDLEVELWHITEFLAG) || (lineNext <= docLines && IsCommentLine(lineNext, styler)))) { - + lineNext++; indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } - + const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK; const int levelBeforeComments = Platform::Maximum(indentCurrentLevel,levelAfterComments); - + // Now set all the indent levels on the lines we skipped // Do this from end to start. Once we encounter one line // which is indented more than the line after the end of // the comment-block, use the level of the block before - + int skipLine = lineNext; int skipLevel = levelAfterComments; - + while (--skipLine > lineCurrent) { int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL); - + if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments) skipLevel = levelBeforeComments; - + int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; - + styler.SetLevel(skipLine, skipLevel | whiteFlag); } @@ -431,7 +431,7 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse } static const char * const pythonWordListDesc[] = { - "Python keywords", + "Keywords", 0 }; diff --git a/src/LexRuby.cxx b/src/LexRuby.cxx index 35804e710..43a874968 100644 --- a/src/LexRuby.cxx +++ b/src/LexRuby.cxx @@ -221,7 +221,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle, } else if (isoperator(ch)) { styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_P_OPERATOR); - } + } } else if (state == SCE_P_WORD) { if (!iswordchar(ch)) { ClassifyWordRb(styler.GetStartSegment(), i - 1, keywords, styler, prevWord); @@ -351,5 +351,10 @@ static void FoldRbDoc(unsigned int startPos, int length, int initStyle, } } } - -LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc); + +static const char * const rubyWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc); diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx index 5af86d9f4..0520c00ed 100644 --- a/src/LexSQL.cxx +++ b/src/LexSQL.cxx @@ -155,4 +155,9 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, styler.ColourTo(lengthDoc - 1, state); } -LexerModule lmSQL(SCLEX_SQL, ColouriseSQLDoc, "sql"); +static const char * const sqlWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmSQL(SCLEX_SQL, ColouriseSQLDoc, "sql", 0, sqlWordListDesc); diff --git a/src/LexVB.cxx b/src/LexVB.cxx index bd1248e04..2e6177e8b 100644 --- a/src/LexVB.cxx +++ b/src/LexVB.cxx @@ -37,7 +37,7 @@ static inline bool IsAWordStart(const int ch) { } static inline bool IsADateCharacter(const int ch) { - return (ch < 0x80) && + return (ch < 0x80) && (isalnum(ch) || ch == '|' || ch == '-' || ch == '/' || ch == ':' || ch == ' ' || ch == '\t'); } @@ -49,7 +49,7 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle, styler.StartAt(startPos); int visibleChars = 0; - + StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { @@ -83,7 +83,7 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle, sc.SetState(SCE_B_DEFAULT); } } else if (sc.state == SCE_B_STRING) { - // VB doubles quotes to preserve them, so just end this string + // VB doubles quotes to preserve them, so just end this string // state now as a following quote will start again if (sc.ch == '\"') { if (tolower(sc.chNext) == 'c') { @@ -104,7 +104,7 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle, sc.ForwardSetState(SCE_B_DEFAULT); } } - + if (sc.state == SCE_B_DEFAULT) { if (sc.ch == '\'') { sc.SetState(SCE_B_COMMENT); @@ -137,7 +137,7 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle, sc.SetState(SCE_B_OPERATOR); } } - + if (sc.atLineEnd) { visibleChars = 0; } @@ -200,6 +200,11 @@ static void ColouriseVBScriptDoc(unsigned int startPos, int length, int initStyl ColouriseVBDoc(startPos, length, initStyle, keywordlists, styler, true); } -LexerModule lmVB(SCLEX_VB, ColouriseVBNetDoc, "vb", FoldVBDoc); -LexerModule lmVBScript(SCLEX_VBSCRIPT, ColouriseVBScriptDoc, "vbscript", FoldVBDoc); +static const char * const vbWordListDesc[] = { + "Keywords", + 0 +}; + +LexerModule lmVB(SCLEX_VB, ColouriseVBNetDoc, "vb", FoldVBDoc, vbWordListDesc); +LexerModule lmVBScript(SCLEX_VBSCRIPT, ColouriseVBScriptDoc, "vbscript", FoldVBDoc, vbWordListDesc); |