summaryrefslogtreecommitdiffstats
path: root/scintilla/lexlib/StyleContext.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/StyleContext.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/StyleContext.cxx')
-rw-r--r--scintilla/lexlib/StyleContext.cxx56
1 files changed, 56 insertions, 0 deletions
diff --git a/scintilla/lexlib/StyleContext.cxx b/scintilla/lexlib/StyleContext.cxx
new file mode 100644
index 0000000..3db04e3
--- /dev/null
+++ b/scintilla/lexlib/StyleContext.cxx
@@ -0,0 +1,56 @@
+// Scintilla source code edit control
+/** @file StyleContext.cxx
+ ** Lexer infrastructure.
+ **/
+// Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
+// This file is in the public domain.
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <assert.h>
+
+#include "ILexer.h"
+
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static void getRange(unsigned int start,
+ unsigned int end,
+ LexAccessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = styler[start + i];
+ i++;
+ }
+ s[i] = '\0';
+}
+
+void StyleContext::GetCurrent(char *s, unsigned int len) {
+ getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len);
+}
+
+static void getRangeLowered(unsigned int start,
+ unsigned int end,
+ LexAccessor &styler,
+ char *s,
+ unsigned int len) {
+ unsigned int i = 0;
+ while ((i < end - start + 1) && (i < len-1)) {
+ s[i] = static_cast<char>(tolower(styler[start + i]));
+ i++;
+ }
+ s[i] = '\0';
+}
+
+void StyleContext::GetCurrentLowered(char *s, unsigned int len) {
+ getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len);
+}