]>
git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/KeyWords.cxx
1 // SciTE - Scintilla based Text Editor
2 // KeyWords.cxx - colourise for particular languages
3 // Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
4 // The License.txt file describes the conditions under which this software may be distributed.
17 #include "Scintilla.h"
20 LexerModule
*LexerModule::base
= 0;
22 LexerModule::LexerModule(int language_
, LexerFunction fn_
) :
23 language(language_
), fn(fn_
) {
28 void LexerModule::Colourise(unsigned int startPos
, int lengthDoc
, int initStyle
,
29 int language
, WordList
*keywordlists
[], Accessor
&styler
) {
30 LexerModule
*lm
= base
;
32 if (lm
->language
== language
) {
33 lm
->fn(startPos
, lengthDoc
, initStyle
, keywordlists
, styler
);
39 // Null language means all style bytes are 0 so just mark the end - no need to fill in.
41 styler
.StartAt(startPos
+ lengthDoc
- 1);
42 styler
.StartSegment(startPos
+ lengthDoc
- 1);
43 styler
.ColourTo(startPos
+ lengthDoc
- 1, 0);