1 // Scintilla source code edit control
2 /** @file StyleContext.cxx
3 ** Lexer infrastructure.
5 // Copyright 1998-2004 by Neil Hodgson <neilh@scintilla.org>
6 // This file is in the public domain.
13 #include "LexAccessor.h"
15 #include "StyleContext.h"
16 #include "CharacterSet.h"
18 using namespace Scintilla
;
20 bool StyleContext::MatchIgnoreCase(const char *s
) {
21 if (MakeLowerCase(ch
) != static_cast<unsigned char>(*s
))
24 if (MakeLowerCase(chNext
) != static_cast<unsigned char>(*s
))
27 for (int n
= 2; *s
; n
++) {
29 MakeLowerCase(styler
.SafeGetCharAt(currentPos
+ n
, 0)))
36 static void getRange(Sci_PositionU start
,
42 while ((i
< end
- start
+ 1) && (i
< len
-1)) {
43 s
[i
] = styler
[start
+ i
];
49 void StyleContext::GetCurrent(char *s
, Sci_PositionU len
) {
50 getRange(styler
.GetStartSegment(), currentPos
- 1, styler
, s
, len
);
53 static void getRangeLowered(Sci_PositionU start
,
59 while ((i
< end
- start
+ 1) && (i
< len
-1)) {
60 s
[i
] = MakeLowerCase(styler
[start
+ i
]);
66 void StyleContext::GetCurrentLowered(char *s
, Sci_PositionU len
) {
67 getRangeLowered(styler
.GetStartSegment(), currentPos
- 1, styler
, s
, len
);