Update Scintilla to version 3.4.4
[TortoiseGit.git] / ext / scintilla / lexlib / LexerSimple.cxx
blobf1b536268fff1365573cce7f5e19e5650b517ccf
1 // Scintilla source code edit control
2 /** @file LexerSimple.cxx
3 ** A simple lexer with no state.
4 **/
5 // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
8 #include <stdlib.h>
9 #include <string.h>
10 #include <stdio.h>
11 #include <stdarg.h>
12 #include <assert.h>
13 #include <ctype.h>
15 #include <string>
17 #include "ILexer.h"
18 #include "Scintilla.h"
19 #include "SciLexer.h"
21 #include "PropSetSimple.h"
22 #include "WordList.h"
23 #include "LexAccessor.h"
24 #include "Accessor.h"
25 #include "LexerModule.h"
26 #include "LexerBase.h"
27 #include "LexerSimple.h"
29 #ifdef SCI_NAMESPACE
30 using namespace Scintilla;
31 #endif
33 LexerSimple::LexerSimple(const LexerModule *module_) : module(module_) {
34 for (int wl = 0; wl < module->GetNumWordLists(); wl++) {
35 if (!wordLists.empty())
36 wordLists += "\n";
37 wordLists += module->GetWordListDescription(wl);
41 const char * SCI_METHOD LexerSimple::DescribeWordListSets() {
42 return wordLists.c_str();
45 void SCI_METHOD LexerSimple::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
46 Accessor astyler(pAccess, &props);
47 module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler);
48 astyler.Flush();
51 void SCI_METHOD LexerSimple::Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
52 if (props.GetInt("fold")) {
53 Accessor astyler(pAccess, &props);
54 module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler);
55 astyler.Flush();