*** empty log message ***
[anjuta-git-plugin.git] / scintilla / StyleContext.cxx
blobd9da0edc47af689c57944109764ee810b247d19e
1 // Scintilla source code edit control
2 /** @file StyleContext.cxx
3 ** Lexer infrastructure.
4 **/
5 // Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
6 // This file is in the public domain.
8 #include <stdlib.h>
9 #include <string.h>
10 #include <ctype.h>
11 #include <stdio.h>
13 #include "Platform.h"
15 #include "PropSet.h"
16 #include "Accessor.h"
17 #include "StyleContext.h"
19 static void getRange(unsigned int start,
20 unsigned int end,
21 Accessor &styler,
22 char *s,
23 unsigned int len) {
24 unsigned int i = 0;
25 while ((i < end - start + 1) && (i < len-1)) {
26 s[i] = styler[start + i];
27 i++;
29 s[i] = '\0';
32 void StyleContext::GetCurrent(char *s, unsigned int len) {
33 getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len);
36 static void getRangeLowered(unsigned int start,
37 unsigned int end,
38 Accessor &styler,
39 char *s,
40 unsigned int len) {
41 unsigned int i = 0;
42 while ((i < end - start + 1) && (i < len-1)) {
43 s[i] = static_cast<char>(tolower(styler[start + i]));
44 i++;
46 s[i] = '\0';
49 void StyleContext::GetCurrentLowered(char *s, unsigned int len) {
50 getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len);