summaryrefslogtreecommitdiffstats
path: root/scintilla/lexlib/LexerSimple.cxx
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-11-16 12:40:48 +0000
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-11-16 12:40:48 +0000
commitba808322ec6be891930225b30b2705f697ac85cf (patch)
tree233edc74a4d288f4541fb27fa775fb67154e78a6 /scintilla/lexlib/LexerSimple.cxx
parent003bf1ed14a32a70f10efa9910f232160cc8e504 (diff)
downloadnotepad2-mod-ba808322ec6be891930225b30b2705f697ac85cf.zip
notepad2-mod-ba808322ec6be891930225b30b2705f697ac85cf.tar.gz
notepad2-mod-ba808322ec6be891930225b30b2705f697ac85cf.tar.bz2
update scintilla to v2.22
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@196 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/lexlib/LexerSimple.cxx')
-rw-r--r--scintilla/lexlib/LexerSimple.cxx57
1 files changed, 57 insertions, 0 deletions
diff --git a/scintilla/lexlib/LexerSimple.cxx b/scintilla/lexlib/LexerSimple.cxx
new file mode 100644
index 0000000..f1b5362
--- /dev/null
+++ b/scintilla/lexlib/LexerSimple.cxx
@@ -0,0 +1,57 @@
+// Scintilla source code edit control
+/** @file LexerSimple.cxx
+ ** A simple lexer with no state.
+ **/
+// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <string>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "PropSetSimple.h"
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "LexerModule.h"
+#include "LexerBase.h"
+#include "LexerSimple.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+LexerSimple::LexerSimple(const LexerModule *module_) : module(module_) {
+ for (int wl = 0; wl < module->GetNumWordLists(); wl++) {
+ if (!wordLists.empty())
+ wordLists += "\n";
+ wordLists += module->GetWordListDescription(wl);
+ }
+}
+
+const char * SCI_METHOD LexerSimple::DescribeWordListSets() {
+ return wordLists.c_str();
+}
+
+void SCI_METHOD LexerSimple::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
+ Accessor astyler(pAccess, &props);
+ module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler);
+ astyler.Flush();
+}
+
+void SCI_METHOD LexerSimple::Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) {
+ if (props.GetInt("fold")) {
+ Accessor astyler(pAccess, &props);
+ module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler);
+ astyler.Flush();
+ }
+}