24#include "LexAccessor.h"
26#include "StyleContext.h"
27#include "CharacterSet.h"
28#include "LexerModule.h"
32using namespace Scintilla;
35static bool strstart(
const char *haystack,
const char *needle) {
36 return strncmp(haystack, needle, strlen(needle)) == 0;
40 return (ch >=
'0') && (ch <=
'9');
44 return (ch >=
'1') && (ch <=
'9');
48 return isascii(ch) && isalpha(ch);
51static inline bool AtEOL(Accessor &styler,
unsigned int i) {
52 return (styler[i] ==
'\n') ||
53 ((styler[i] ==
'\r') && (styler.SafeGetCharAt(i + 1) !=
'\n'));
58 return (ch ==
'=') || (ch ==
'+') || (ch ==
'>') || (ch ==
'<') ||
59 (ch ==
'|') || (ch ==
'?') || (ch ==
'*');
64 return (ch ==
'\\') || (ch ==
'.') || (ch ==
';') ||
65 (ch ==
'\"') || (ch ==
'\'') || (ch ==
'/');
70 unsigned int lengthLine,
71 unsigned int startLine,
73 WordList *keywordlists[],
76 unsigned int offset = 0;
81 WordList &keywords = *keywordlists[0];
82 WordList &keywords2 = *keywordlists[1];
88 bool continueProcessing =
true;
92 char sKeywordBuffer[10];
96 while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
105 if (lineBuffer[offset] ==
':') {
106 if (lineBuffer[offset + 1] ==
':') {
116 (lineBuffer[offset + 1] ==
':') &&
117 ((isspacechar(lineBuffer[offset + 2])) ||
118 (((lineBuffer[offset + 2] ==
'\\')) &&
119 (isspacechar(lineBuffer[offset + 3]))))) {
126 if (lineBuffer[offset] ==
'@') {
131 while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
136 while (offset < lengthLine) {
137 if (offset > startLine) {
143 for (; offset < lengthLine && wbl < 80 &&
144 !isspacechar(lineBuffer[offset]); wbl++, offset++) {
145 wordBuffer[wbl] =
static_cast<char>(tolower(lineBuffer[offset]));
147 wordBuffer[wbl] =
'\0';
151 if (CompareCaseInsensitive(wordBuffer,
"rem") == 0) {
158 if ((cmdLoc == offset - wbl) &&
159 ((wordBuffer[0] ==
':') ||
160 (wordBuffer[0] ==
'\\') ||
161 (wordBuffer[0] ==
'.'))) {
167 }
else if (keywords2.InList(wordBuffer)) {
181 }
else if ((keywords.InList(wordBuffer)) &&
182 (continueProcessing)) {
184 if ((CompareCaseInsensitive(wordBuffer,
"echo") == 0) ||
185 (CompareCaseInsensitive(wordBuffer,
"goto") == 0) ||
186 (CompareCaseInsensitive(wordBuffer,
"prompt") == 0) ||
187 (CompareCaseInsensitive(wordBuffer,
"set") == 0)) {
188 continueProcessing =
false;
191 if ((CompareCaseInsensitive(wordBuffer,
"errorlevel") == 0) ||
192 (CompareCaseInsensitive(wordBuffer,
"exist") == 0)) {
196 while ((cmdLoc < lengthLine) &&
197 (isspacechar(lineBuffer[cmdLoc]))) {
201 while ((cmdLoc < lengthLine) &&
202 (!isspacechar(lineBuffer[cmdLoc]))) {
206 while ((cmdLoc < lengthLine) &&
207 (isspacechar(lineBuffer[cmdLoc]))) {
211 }
else if ((CompareCaseInsensitive(wordBuffer,
"call") == 0) ||
212 (CompareCaseInsensitive(wordBuffer,
"do") == 0) ||
213 (CompareCaseInsensitive(wordBuffer,
"loadhigh") == 0) ||
214 (CompareCaseInsensitive(wordBuffer,
"lh") == 0)) {
218 while ((cmdLoc < lengthLine) &&
219 (isspacechar(lineBuffer[cmdLoc]))) {
227 }
else if ((wordBuffer[0] !=
'%') &&
228 (wordBuffer[0] !=
'!') &&
230 (continueProcessing)) {
234 sKeywordFound =
false;
235 for (
unsigned int keywordLength = 2; keywordLength < wbl && keywordLength < 7 && !sKeywordFound; keywordLength++) {
238 for (; wbo < keywordLength; wbo++) {
239 sKeywordBuffer[wbo] =
static_cast<char>(wordBuffer[wbo]);
241 sKeywordBuffer[wbo] =
'\0';
243 if ((keywords.InList(sKeywordBuffer)) &&
246 sKeywordFound =
true;
248 if (CompareCaseInsensitive(sKeywordBuffer,
"echo") == 0) {
249 continueProcessing =
false;
252 styler.ColourTo(startLine + offset - 1 - (wbl - wbo),
SCE_BAT_WORD);
254 offset -= (wbl - wbo);
258 if (!sKeywordFound) {
261 if (cmdLoc == offset - wbl) {
263 while ((wbo < wbl) &&
264 (wordBuffer[wbo] !=
'%') &&
265 (wordBuffer[wbo] !=
'!') &&
271 cmdLoc = offset - (wbl - wbo);
273 offset -= (wbl - wbo);
275 if (CompareCaseInsensitive(wordBuffer,
"choice") == 0) {
276 continueProcessing =
false;
279 if (CompareCaseInsensitive(wordBuffer,
"start") == 0) {
283 while ((cmdLoc < lengthLine) &&
284 (isspacechar(lineBuffer[cmdLoc]))) {
288 if (lineBuffer[cmdLoc] ==
'/') {
290 while ((cmdLoc < lengthLine) &&
291 (!isspacechar(lineBuffer[cmdLoc]))) {
295 while ((cmdLoc < lengthLine) &&
296 (isspacechar(lineBuffer[cmdLoc]))) {
304 }
else if (keywords2.InList(wordBuffer)) {
313 while ((wbo < wbl) &&
314 (wordBuffer[wbo] !=
'%') &&
315 (wordBuffer[wbo] !=
'!') &&
321 styler.ColourTo(startLine + offset - 1 - (wbl - wbo),
SCE_BAT_DEFAULT);
323 offset -= (wbl - wbo);
327 }
else if (wordBuffer[0] ==
'%') {
332 while ((wbo < wbl) &&
333 (wordBuffer[wbo] !=
'%') &&
339 if (((
Is0To9(wordBuffer[1])) || (wordBuffer[1] ==
'*')) &&
340 (wordBuffer[wbo] !=
'%')) {
342 if (cmdLoc == offset - wbl) {
343 cmdLoc = offset - (wbl - 2);
350 }
else if (((wbl > 1) && (wordBuffer[1] ==
'~')) ||
351 ((wbl > 2) && (wordBuffer[1] ==
'%') && (wordBuffer[2] ==
'~'))) {
353 if (cmdLoc == offset - wbl) {
354 cmdLoc = offset - (wbl - wbo);
359 offset -= (wbl - wbo);
361 }
else if ((wordBuffer[1] !=
'%') &&
362 (wordBuffer[wbo] ==
'%')) {
365 if (cmdLoc == offset - wbl) {
366 cmdLoc = offset - (wbl - wbo);
371 offset -= (wbl - wbo);
375 (wordBuffer[1] ==
'%') &&
376 (wordBuffer[2] !=
'%') &&
380 if (cmdLoc == offset - wbl) {
381 cmdLoc = offset - (wbl - 3);
389 }
else if (wordBuffer[0] ==
'!') {
394 while ((wbo < wbl) &&
395 (wordBuffer[wbo] !=
'!') &&
400 if (wordBuffer[wbo] ==
'!') {
403 if (cmdLoc == offset - wbl) {
404 cmdLoc = offset - (wbl - wbo);
409 offset -= (wbl - wbo);
416 if ((wordBuffer[0] ==
'=') && (wordBuffer[1] ==
'=')) {
420 while ((cmdLoc < lengthLine) &&
421 (isspacechar(lineBuffer[cmdLoc]))) {
429 }
else if (wordBuffer[0] ==
'|') {
431 cmdLoc = offset - wbl + 1;
433 while ((cmdLoc < lengthLine) &&
434 (isspacechar(lineBuffer[cmdLoc]))) {
444 if (wordBuffer[0] ==
'>') {
446 continueProcessing =
true;
456 while ((wbo < wbl) &&
457 (wordBuffer[wbo] !=
'%') &&
458 (wordBuffer[wbo] !=
'!') &&
464 styler.ColourTo(startLine + offset - 1 - (wbl - wbo),
SCE_BAT_DEFAULT);
466 offset -= (wbl - wbo);
469 while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) {
478 unsigned int startPos,
481 WordList *keywordlists[],
484 char lineBuffer[1024];
486 styler.StartAt(startPos);
487 styler.StartSegment(startPos);
488 unsigned int linePos = 0;
489 unsigned int startLine = startPos;
490 for (
unsigned int i = startPos; i < startPos + length; i++) {
491 lineBuffer[linePos++] = styler[i];
492 if (
AtEOL(styler, i) || (linePos >=
sizeof(lineBuffer) - 1)) {
494 lineBuffer[linePos] =
'\0';
501 lineBuffer[linePos] =
'\0';
503 keywordlists, styler);
507#define DIFF_BUFFER_START_SIZE 16
516 if (0 == strncmp(lineBuffer,
"diff ", 5)) {
518 }
else if (0 == strncmp(lineBuffer,
"Index: ", 7)) {
520 }
else if (0 == strncmp(lineBuffer,
"---", 3) && lineBuffer[3] !=
'-') {
522 if (lineBuffer[3] ==
' ' && atoi(lineBuffer + 4) && !strchr(lineBuffer,
'/'))
524 else if (lineBuffer[3] ==
'\r' || lineBuffer[3] ==
'\n')
528 }
else if (0 == strncmp(lineBuffer,
"+++ ", 4)) {
531 if (atoi(lineBuffer+4) && !strchr(lineBuffer,
'/'))
535 }
else if (0 == strncmp(lineBuffer,
"====", 4)) {
537 }
else if (0 == strncmp(lineBuffer,
"***", 3)) {
541 if (lineBuffer[3] ==
' ' && atoi(lineBuffer+4) && !strchr(lineBuffer,
'/'))
543 else if (lineBuffer[3] ==
'*')
547 }
else if (0 == strncmp(lineBuffer,
"? ", 2)) {
549 }
else if (lineBuffer[0] ==
'@') {
551 }
else if (lineBuffer[0] >=
'0' && lineBuffer[0] <=
'9') {
553 }
else if (lineBuffer[0] ==
'-' || lineBuffer[0] ==
'<') {
555 }
else if (lineBuffer[0] ==
'+' || lineBuffer[0] ==
'>') {
557 }
else if (lineBuffer[0] ==
'!') {
559 }
else if (lineBuffer[0] !=
' ') {
566static void ColouriseDiffDoc(
unsigned int startPos,
int length,
int, WordList *[], Accessor &styler) {
568 styler.StartAt(startPos);
569 styler.StartSegment(startPos);
570 unsigned int linePos = 0;
571 for (
unsigned int i = startPos; i < startPos + length; i++) {
572 if (
AtEOL(styler, i)) {
574 lineBuffer[linePos] = 0;
579 lineBuffer[linePos++] = styler[i];
581 lineBuffer[linePos++] = 0;
586 lineBuffer[linePos] = 0;
592static void FoldDiffDoc(
unsigned int startPos,
int length,
int, WordList *[], Accessor &styler) {
593 int curLine = styler.GetLine(startPos);
594 int curLineStart = styler.LineStart(curLine);
595 int prevLevel = curLine > 0 ? styler.LevelAt(curLine - 1) : SC_FOLDLEVELBASE;
599 int lineType = styler.StyleAt(curLineStart);
601 nextLevel = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG;
603 nextLevel = (SC_FOLDLEVELBASE + 1) | SC_FOLDLEVELHEADERFLAG;
605 nextLevel = (SC_FOLDLEVELBASE + 2) | SC_FOLDLEVELHEADERFLAG;
606 else if (prevLevel & SC_FOLDLEVELHEADERFLAG)
607 nextLevel = (prevLevel & SC_FOLDLEVELNUMBERMASK) + 1;
609 nextLevel = prevLevel;
611 if ((nextLevel & SC_FOLDLEVELHEADERFLAG) && (nextLevel == prevLevel))
612 styler.SetLevel(curLine-1, prevLevel & ~SC_FOLDLEVELHEADERFLAG);
614 styler.SetLevel(curLine, nextLevel);
615 prevLevel = nextLevel;
617 curLineStart = styler.LineStart(++curLine);
618 }
while (
static_cast<int>(startPos) + length > curLineStart);
623 unsigned int lengthLine,
624 unsigned int startLine,
632 while ((i < lengthLine) && isspacechar(lineBuffer[i]))
634 if (i < lengthLine) {
635 if (lineBuffer[i] ==
'#') {
638 if (
strstart(lineBuffer,
"#, ") && strstr(lineBuffer,
"fuzzy"))
643 if (lineBuffer[0] ==
'"') {
645 styler.ColourTo(endPos, state);
648 }
else if (
strstart(lineBuffer,
"msgid")) {
651 }
else if (
strstart(lineBuffer,
"msgstr")) {
654 }
else if (
strstart(lineBuffer,
"msgctxt")) {
660 while ((i < lengthLine) && ! isspacechar(lineBuffer[i]))
662 styler.ColourTo(startLine + i - 1, state_start);
664 styler.ColourTo(endPos, state);
672static void ColourisePoDoc(
unsigned int startPos,
int length,
int, WordList *[], Accessor &styler) {
673 char lineBuffer[1024];
674 styler.StartAt(startPos);
675 styler.StartSegment(startPos);
676 unsigned int linePos = 0;
677 unsigned int startLine = startPos;
678 for (
unsigned int i = startPos; i < startPos + length; i++) {
679 lineBuffer[linePos++] = styler[i];
680 if (
AtEOL(styler, i) || (linePos >=
sizeof(lineBuffer) - 1)) {
682 lineBuffer[linePos] =
'\0';
689 ColourisePoLine(lineBuffer, linePos, startLine, startPos + length - 1, styler);
694 return (ch ==
'=') || (ch ==
':');
699 unsigned int lengthLine,
700 unsigned int startLine,
703 bool allowInitialSpaces) {
706 if (allowInitialSpaces) {
707 while ((i < lengthLine) && isspacechar(lineBuffer[i]))
710 if (isspacechar(lineBuffer[i]))
714 if (i < lengthLine) {
715 if (lineBuffer[i] ==
'#' || lineBuffer[i] ==
'!' || lineBuffer[i] ==
';') {
717 }
else if (lineBuffer[i] ==
'[') {
719 }
else if (lineBuffer[i] ==
'@') {
726 while ((i < lengthLine) && !
isassignchar(lineBuffer[i]))
741static void ColourisePropsDoc(
unsigned int startPos,
int length,
int, WordList *[], Accessor &styler) {
742 char lineBuffer[1024];
743 styler.StartAt(startPos);
744 styler.StartSegment(startPos);
745 unsigned int linePos = 0;
746 unsigned int startLine = startPos;
752 bool allowInitialSpaces = styler.GetPropertyInt(
"lexer.props.allow.initial.spaces", 1) != 0;
754 for (
unsigned int i = startPos; i < startPos + length; i++) {
755 lineBuffer[linePos++] = styler[i];
756 if (
AtEOL(styler, i) || (linePos >=
sizeof(lineBuffer) - 1)) {
758 lineBuffer[linePos] =
'\0';
765 ColourisePropsLine(lineBuffer, linePos, startLine, startPos + length - 1, styler, allowInitialSpaces);
771static void FoldPropsDoc(
unsigned int startPos,
int length,
int, WordList *[], Accessor &styler) {
772 bool foldCompact = styler.GetPropertyInt(
"fold.compact", 1) != 0;
774 unsigned int endPos = startPos + length;
775 int visibleChars = 0;
776 int lineCurrent = styler.GetLine(startPos);
778 char chNext = styler[startPos];
779 int styleNext = styler.StyleAt(startPos);
780 bool headerPoint =
false;
783 for (
unsigned int i = startPos; i < endPos; i++) {
785 chNext = styler[i+1];
787 int style = styleNext;
788 styleNext = styler.StyleAt(i + 1);
789 bool atEOL = (ch ==
'\r' && chNext !=
'\n') || (ch ==
'\n');
796 lev = SC_FOLDLEVELBASE;
798 if (lineCurrent > 0) {
799 int levelPrevious = styler.LevelAt(lineCurrent - 1);
801 if (levelPrevious & SC_FOLDLEVELHEADERFLAG) {
802 lev = SC_FOLDLEVELBASE + 1;
804 lev = levelPrevious & SC_FOLDLEVELNUMBERMASK;
809 lev = SC_FOLDLEVELBASE;
811 if (visibleChars == 0 && foldCompact)
812 lev |= SC_FOLDLEVELWHITEFLAG;
815 lev |= SC_FOLDLEVELHEADERFLAG;
817 if (lev != styler.LevelAt(lineCurrent)) {
818 styler.SetLevel(lineCurrent, lev);
825 if (!isspacechar(ch))
829 if (lineCurrent > 0) {
830 int levelPrevious = styler.LevelAt(lineCurrent - 1);
831 if (levelPrevious & SC_FOLDLEVELHEADERFLAG) {
832 lev = SC_FOLDLEVELBASE + 1;
834 lev = levelPrevious & SC_FOLDLEVELNUMBERMASK;
837 lev = SC_FOLDLEVELBASE;
839 int flagsNext = styler.LevelAt(lineCurrent);
840 styler.SetLevel(lineCurrent, lev | (flagsNext & ~SC_FOLDLEVELNUMBERMASK));
845 unsigned int lengthLine,
846 unsigned int startLine,
851 int lastNonSpace = -1;
853 bool bSpecial =
false;
856 bool bCommand =
false;
857 if ((lengthLine > 0) && (lineBuffer[0] ==
'\t'))
861 while ((i < lengthLine) && isspacechar(lineBuffer[i])) {
864 if (lineBuffer[i] ==
'#') {
868 if (lineBuffer[i] ==
'!') {
873 while (i < lengthLine) {
874 if (lineBuffer[i] ==
'$' && lineBuffer[i + 1] ==
'(') {
875 styler.ColourTo(startLine + i - 1, state);
879 if (--varCount == 0) {
880 styler.ColourTo(startLine + i, state);
886 if (!bSpecial && !bCommand) {
887 if (lineBuffer[i] ==
':') {
888 if (((i + 1) < lengthLine) && (lineBuffer[i + 1] ==
'=')) {
890 if (lastNonSpace >= 0)
897 if (lastNonSpace >= 0)
904 }
else if (lineBuffer[i] ==
'=') {
905 if (lastNonSpace >= 0)
913 if (!isspacechar(lineBuffer[i])) {
925static void ColouriseMakeDoc(
unsigned int startPos,
int length,
int, WordList *[], Accessor &styler) {
926 char lineBuffer[1024];
927 styler.StartAt(startPos);
928 styler.StartSegment(startPos);
929 unsigned int linePos = 0;
930 unsigned int startLine = startPos;
931 for (
unsigned int i = startPos; i < startPos + length; i++) {
932 lineBuffer[linePos++] = styler[i];
933 if (
AtEOL(styler, i) || (linePos >=
sizeof(lineBuffer) - 1)) {
935 lineBuffer[linePos] =
'\0';
942 ColouriseMakeLine(lineBuffer, linePos, startLine, startPos + length - 1, styler);
947 if (lineBuffer[0] ==
'>') {
950 }
else if (lineBuffer[0] ==
'<') {
953 }
else if (lineBuffer[0] ==
'!') {
955 }
else if (lineBuffer[0] ==
'+') {
961 }
else if (lineBuffer[0] ==
'-') {
967 }
else if (
strstart(lineBuffer,
"cf90-")) {
970 }
else if (
strstart(lineBuffer,
"fortcom:")) {
973 }
else if (strstr(lineBuffer,
"File \"") && strstr(lineBuffer,
", line ")) {
975 }
else if (strstr(lineBuffer,
" in ") && strstr(lineBuffer,
" on line ")) {
977 }
else if ((
strstart(lineBuffer,
"Error ") ||
978 strstart(lineBuffer,
"Warning ")) &&
979 strstr(lineBuffer,
" at (") &&
980 strstr(lineBuffer,
") : ") &&
981 (strstr(lineBuffer,
" at (") < strstr(lineBuffer,
") : "))) {
984 }
else if (
strstart(lineBuffer,
"Error ")) {
987 }
else if (
strstart(lineBuffer,
"Warning ")) {
990 }
else if (strstr(lineBuffer,
"at line ") &&
991 (strstr(lineBuffer,
"at line ") < (lineBuffer + lengthLine)) &&
992 strstr(lineBuffer,
"file ") &&
993 (strstr(lineBuffer,
"file ") < (lineBuffer + lengthLine))) {
996 }
else if (strstr(lineBuffer,
" at ") &&
997 (strstr(lineBuffer,
" at ") < (lineBuffer + lengthLine)) &&
998 strstr(lineBuffer,
" line ") &&
999 (strstr(lineBuffer,
" line ") < (lineBuffer + lengthLine)) &&
1000 (strstr(lineBuffer,
" at ") < (strstr(lineBuffer,
" line ")))) {
1003 }
else if ((memcmp(lineBuffer,
" at ", 6) == 0) &&
1004 strstr(lineBuffer,
":line ")) {
1007 }
else if (
strstart(lineBuffer,
"Line ") &&
1008 strstr(lineBuffer,
", file ")) {
1011 }
else if (
strstart(lineBuffer,
"line ") &&
1012 strstr(lineBuffer,
" column ")) {
1015 }
else if (
strstart(lineBuffer,
"\tat ") &&
1016 strstr(lineBuffer,
"(") &&
1017 strstr(lineBuffer,
".java:")) {
1030 bool initialTab = (lineBuffer[0] ==
'\t');
1031 bool initialColonPart =
false;
1033 stGccStart, stGccDigit, stGccColumn, stGcc,
1034 stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet,
1035 stCtagsStart, stCtagsStartString, stCtagsStringDollar, stCtags,
1037 } state = stInitial;
1038 for (
unsigned int i = 0; i < lengthLine; i++) {
1039 char ch = lineBuffer[i];
1041 if ((i + 1) < lengthLine)
1042 chNext = lineBuffer[i + 1];
1043 if (state == stInitial) {
1046 if ((chNext !=
'\\') && (chNext !=
'/') && (chNext !=
' ')) {
1050 }
else if (chNext ==
' ') {
1051 initialColonPart =
true;
1053 }
else if ((ch ==
'(') &&
Is1To9(chNext) && (!initialTab)) {
1057 }
else if ((ch ==
'\t') && (!initialTab)) {
1059 state = stCtagsStart;
1061 }
else if (state == stGccStart) {
1062 state =
Is1To9(ch) ? stGccDigit : stUnrecognized;
1063 }
else if (state == stGccDigit) {
1065 state = stGccColumn;
1067 }
else if (!
Is0To9(ch)) {
1068 state = stUnrecognized;
1070 }
else if (state == stGccColumn) {
1077 }
else if (state == stMsStart) {
1078 state =
Is0To9(ch) ? stMsDigit : stUnrecognized;
1079 }
else if (state == stMsDigit) {
1081 state = stMsDigitComma;
1082 }
else if (ch ==
')') {
1083 state = stMsBracket;
1084 }
else if ((ch !=
' ') && !
Is0To9(ch)) {
1085 state = stUnrecognized;
1087 }
else if (state == stMsBracket) {
1088 if ((ch ==
' ') && (chNext ==
':')) {
1090 }
else if ((ch ==
':' && chNext ==
' ') || (ch ==
' ')) {
1093 unsigned int j, chPos;
1100 for (j = i + numstep; j < lengthLine &&
IsAlphabetic(lineBuffer[j]) && chPos <
sizeof(word) - 1; j++)
1101 word[chPos++] = lineBuffer[j];
1103 if (!CompareCaseInsensitive(word,
"error") || !CompareCaseInsensitive(word,
"warning") ||
1104 !CompareCaseInsensitive(word,
"fatal") || !CompareCaseInsensitive(word,
"catastrophic") ||
1105 !CompareCaseInsensitive(word,
"note") || !CompareCaseInsensitive(word,
"remark")) {
1108 state = stUnrecognized;
1110 state = stUnrecognized;
1112 }
else if (state == stMsDigitComma) {
1116 }
else if ((ch !=
' ') && !
Is0To9(ch)) {
1117 state = stUnrecognized;
1119 }
else if (state == stCtagsStart) {
1120 if ((lineBuffer[i - 1] ==
'\t') &&
1121 ((ch ==
'/' && lineBuffer[i + 1] ==
'^') ||
Is0To9(ch))) {
1124 }
else if ((ch ==
'/') && (lineBuffer[i + 1] ==
'^')) {
1125 state = stCtagsStartString;
1127 }
else if ((state == stCtagsStartString) && ((lineBuffer[i] ==
'$') && (lineBuffer[i + 1] ==
'/'))) {
1128 state = stCtagsStringDollar;
1132 if (state == stGcc) {
1134 }
else if ((state == stMsVc) || (state == stMsDotNet)) {
1136 }
else if ((state == stCtagsStringDollar) || (state == stCtags)) {
1146 unsigned int lengthLine,
1147 unsigned int endPos,
1149 bool valueSeparate) {
1150 int startValue = -1;
1152 if (valueSeparate && (startValue >= 0)) {
1153 styler.ColourTo(endPos - (lengthLine - startValue), style);
1156 styler.ColourTo(endPos, style);
1161 char lineBuffer[10000];
1162 styler.StartAt(startPos);
1163 styler.StartSegment(startPos);
1164 unsigned int linePos = 0;
1171 bool valueSeparate = styler.GetPropertyInt(
"lexer.errorlist.value.separate", 0) != 0;
1172 for (
unsigned int i = startPos; i < startPos + length; i++) {
1173 lineBuffer[linePos++] = styler[i];
1174 if (
AtEOL(styler, i) || (linePos >=
sizeof(lineBuffer) - 1)) {
1176 lineBuffer[linePos] =
'\0';
1187 return (ch ==
'#') || (ch ==
'$') || (ch ==
'%') || (ch ==
'&') || (ch ==
'_') ||
1188 (ch ==
'{') || (ch ==
'}') || (ch ==
' ');
1192 return (ch ==
' ') || (ch ==
'\t');
1196 return (ch ==
' ') || (ch ==
'\t') || (ch ==
'\r') || (ch ==
'\n');
1200 return isascii(ch) && isalpha(ch);
1205 if (styler.SafeGetCharAt(i) ==
'{') {
1208 if (styler.SafeGetCharAt(i) ==
'}') {
1211 styler.SafeGetCharAt(i)!=
'*') {
1226 ch = styler.SafeGetCharAt(i);
1240 unsigned int l =
static_cast<unsigned int>(strlen(needle));
1241 int ini = start-l+1;
1244 while (i < l && i < 32) {
1245 s[i] = styler.SafeGetCharAt(ini + i);
1250 return (strcmp(s, needle) == 0);
1254 WordList *[], Accessor &styler) {
1256 styler.StartAt(startPos);
1258 int state = initStyle;
1259 char chNext = styler.SafeGetCharAt(startPos);
1260 styler.StartSegment(startPos);
1261 int lengthDoc = startPos + length;
1262 char chVerbatimDelim =
'\0';
1264 for (
int i = startPos; i < lengthDoc; i++) {
1266 chNext = styler.SafeGetCharAt(i + 1);
1268 if (styler.IsLeadByte(ch)) {
1270 chNext = styler.SafeGetCharAt(i + 1);
1278 styler.ColourTo(i - 1, state);
1285 if (chNext ==
'(' || chNext ==
'[') {
1286 styler.ColourTo(i-1, state);
1292 chNext = styler.SafeGetCharAt(i+1);
1300 styler.ColourTo(i - 1, state);
1302 if (chNext ==
'$') {
1305 chNext = styler.SafeGetCharAt(i + 1);
1309 styler.ColourTo(i - 1, state);
1315 styler.ColourTo(i-1, state);
1320 styler.ColourTo(i, state);
1325 styler.ColourTo(i, state);
1334 chNext !=
'*' && chNext !=
' ') {
1335 chVerbatimDelim = chNext;
1342 styler.ColourTo(i, state);
1348 styler.ColourTo(i, state);
1363 styler.ColourTo(i, state);
1366 chNext = styler.SafeGetCharAt(i+1);
1370 styler.ColourTo(i, state);
1375 chNext = styler.SafeGetCharAt(i+1);
1379 styler.ColourTo(i, state);
1381 }
else if (ch ==
'\\' && chNext ==
')') {
1382 styler.ColourTo(i-1, state);
1385 chNext = styler.SafeGetCharAt(i+1);
1387 }
else if (ch ==
'\\') {
1393 styler.ColourTo(i-1, state);
1403 if (chNext ==
'$') {
1405 chNext = styler.SafeGetCharAt(i + 1);
1406 styler.ColourTo(i, state);
1412 }
else if (ch ==
'\\' && chNext ==
']') {
1413 styler.ColourTo(i-1, state);
1416 chNext = styler.SafeGetCharAt(i+1);
1418 }
else if (ch ==
'\\') {
1424 styler.ColourTo(i-1, state);
1427 styler.ColourTo(i-1, state);
1435 if (ch ==
'\r' || ch ==
'\n') {
1436 styler.ColourTo(i - 1, state);
1447 styler.ColourTo(i-1, state);
1461 styler.ColourTo(i-1, state);
1466 }
else if (chNext == chVerbatimDelim) {
1467 styler.ColourTo(i+1, state);
1469 chVerbatimDelim =
'\0';
1470 }
else if (chVerbatimDelim !=
'\0' && (ch ==
'\n' || ch ==
'\r')) {
1473 chVerbatimDelim =
'\0';
1478 styler.ColourTo(lengthDoc-1, state);
1482 "Internal Commands",
1483 "External Commands",
1495 styler.StartAt(startPos + length - 1);
1496 styler.StartSegment(startPos + length - 1);
1497 styler.ColourTo(startPos + length - 1, 0);
1577 return (isascii(ch) && (isalpha(ch) || ch ==
'_' || ch ==
'\'')) || !isascii(ch);
1581 return (isascii(ch) && (isalnum(ch) || ch ==
'_')) || !isascii(ch);
1586 if (IsAlphaNumeric(ch))
1588 if (ch ==
'+' || ch ==
'-' || ch ==
'*' || ch ==
'/' ||
1589 ch ==
'^' || ch ==
')' || ch ==
'(' || ch ==
'?' ||
1590 ch ==
'=' || ch ==
'|' || ch ==
'{' || ch ==
'}' ||
1591 ch ==
'[' || ch ==
']' || ch ==
':' || ch ==
';' ||
1592 ch ==
'<' || ch ==
'>' || ch ==
',' || ch ==
'!' ||
1593 ch ==
'&' || ch ==
'%' || ch ==
'\\')
1609 return ch ==
'c' || ch ==
'w' || ch ==
'd';
1652 "Predefined variables",
1655 "Operator keywords",
1656 "Documentation keywords",
1657 "Procedure commands",
1666 "Set this property to 0 to disable syntax based folding.");
1671 "Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
1674 "Set this property to 0 to disable folding explicit fold points when fold.comment=1.");
1677 "The string to use for explicit fold start points, replacing the standard //{.");
1680 "The string to use for explicit fold end points, replacing the standard //}.");
1683 "Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
1734 return osNSCR.PropertyNames();
1742 int SCI_METHOD
PropertySet(
const char *key,
const char *val);
1744 return osNSCR.DescribeWordListSets();
1746 int SCI_METHOD
WordListSet(
int n,
const char *wl);
1747 void SCI_METHOD
Lex(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess);
1748 void SCI_METHOD
Fold(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess);
1770 WordList *wordListN = 0;
1786 std::string words = wl;
1788 if (words.find(
';') != std::string::npos)
1812 int firstModification = -1;
1816 if (*wordListN != wlNew) {
1818 firstModification = 0;
1821 return firstModification;
1824void SCI_METHOD
LexerNSCR::Lex(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess)
1826 LexAccessor styler(pAccess);
1827 int nInstallStart = -1;
1843 initStyle = styler.StyleAt(startPos);
1851 StyleContext sc(startPos, length, initStyle, styler);
1853 int curLine = styler.GetLine(startPos);
1854 int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
1855 bool numFloat =
false;
1856 bool numHex =
false;
1857 bool possibleMethod =
false;
1859 for (; sc.More(); sc.Forward()) {
1861 if (sc.atLineStart) {
1862 curLine = styler.GetLine(sc.currentPos);
1863 styler.SetLineState(curLine, curNcLevel);
1883 else if (sc.ch ==
'.' && sc.chNext !=
'.' && !numFloat)
1889 else if (( sc.ch ==
'-' || sc.ch ==
'+' )
1890 && (sc.chPrev ==
'e' || sc.chPrev ==
'E' ))
1895 else if (( sc.ch ==
'e' || sc.ch ==
'E' )
1896 && (sc.chNext ==
'+' || sc.chNext ==
'-' || isdigit(sc.chNext)))
1901 else if (sc.ch ==
'i' && !isdigit(sc.chNext))
1912 if (!
IsWord(sc.ch) && sc.ch !=
'~')
1924 sc.GetCurrent(s,
sizeof(s));
1928 sc.GetCurrentLowered(s,
sizeof(s));
1973 else if (sc.ch ==
'(')
1977 else if (sc.ch ==
'{')
1985 possibleMethod =
false;
1991 if (sc.Match(
'*',
'#')) {
1999 if (sc.atLineStart) {
2006 if (sc.chNext ==
'"' || sc.chNext ==
'\\')
2011 else if (sc.ch ==
'"')
2018 if (sc.ch ==
' ' || sc.ch ==
'(' || sc.atLineStart)
2028 int nCurrentState = sc.state;
2032 while (sc.More() &&
IsWord(sc.ch))
2036 sc.GetCurrent(s,
sizeof(s));
2041 sc.ChangeState(nCurrentState);
2043 sc.SetState(nCurrentState);
2049 if (IsADigit(sc.ch) || (sc.ch ==
'.' && IsADigit(sc.chNext)))
2052 numFloat = sc.ch ==
'.';
2054 else if (sc.ch ==
'.' &&
IsWordStart(
static_cast<char>(sc.chNext)))
2055 possibleMethod =
true;
2060 else if (sc.ch ==
'$')
2064 else if (sc.Match(
"#*!"))
2069 else if (sc.Match(
"##!"))
2074 else if (sc.Match(
'#',
'*'))
2079 else if (sc.Match(
'#',
'#'))
2084 else if (sc.ch ==
'"')
2088 else if (sc.ch ==
'#')
2092 else if (sc.ch ==
'@')
2096 else if (
IsOperator(
static_cast<char>(sc.ch)))
2099 && (sc.Match(
"<wp>") || sc.Match(
"<this>") || sc.Match(
"<loadpath>") || sc.Match(
"<savepath>") || sc.Match(
"<plotpath>") || sc.Match(
"<procpath>") || sc.Match(
"<scriptpath>")))
2103 else if ((sc.ch ==
'<') && sc.Match(
"<install>"))
2105 nInstallStart = sc.currentPos;
2107 else if ((sc.ch ==
'<') && sc.Match(
"<endinstall>") && nInstallStart != -1)
2110 styler.StartAt(nInstallStart);
2111 styler.StartSegment(nInstallStart);
2113 for (
int i = nInstallStart; i <= sc.currentPos; i++)
2145void SCI_METHOD
LexerNSCR::Fold(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess)
2151 LexAccessor styler(pAccess);
2153 unsigned int endPos = startPos + length;
2154 int visibleChars = 0;
2155 int lineCurrent = styler.GetLine(startPos);
2156 int levelCurrent = SC_FOLDLEVELBASE;
2157 if (lineCurrent > 0)
2158 levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
2159 int levelMinCurrent = levelCurrent;
2160 int levelNext = levelCurrent;
2161 char chNext = styler[startPos];
2162 int styleNext = styler.StyleAt(startPos);
2163 int style = initStyle;
2165 bool foundElse =
false;
2167 for (
unsigned int i = startPos; i < endPos; i++)
2170 chNext = styler.SafeGetCharAt(i + 1);
2171 int stylePrev = style;
2173 styleNext = styler.StyleAt(i + 1);
2174 bool atEOL = (ch ==
'\r' && chNext !=
'\n') || (ch ==
'\n');
2189 if (userDefinedFoldMarkers)
2202 if ((ch ==
'#') && (chNext ==
'#'))
2204 char chNext2 = styler.SafeGetCharAt(i + 2);
2209 else if (chNext2 ==
'}')
2219 std::string current;
2224 while (styler.StyleAt(n) == style && isgraph(styler.SafeGetCharAt(n)))
2226 current += styler.SafeGetCharAt(n);
2230 if (
blockEndWords.InList(current.c_str()) && isCommand == (current.front() !=
'<'))
2235 else if (styler.SafeGetCharAt(i-1) !=
'd'
2236 && styler.SafeGetCharAt(i-1) !=
'e'
2238 && isCommand == (current.front() !=
'<'))
2263 if (atEOL || (i == endPos-1))
2268 nc = styler.GetLineState(lineCurrent);
2269 nc -= lineCurrent>0? styler.GetLineState(lineCurrent-1): 0;
2272 int levelUse = levelCurrent;
2275 levelUse = levelMinCurrent;
2277 int lev = levelUse | levelNext << 16;
2279 lev |= SC_FOLDLEVELWHITEFLAG;
2280 if (levelUse < levelNext || foundElse)
2281 lev |= SC_FOLDLEVELHEADERFLAG;
2282 if (lev != styler.LevelAt(lineCurrent))
2284 styler.SetLevel(lineCurrent, lev);
2287 levelCurrent = levelNext;
2288 levelMinCurrent = levelCurrent;
2329 "Predefined variables",
2332 "Operator keywords",
2333 "Documentation keywords",
2342 "Set this property to 0 to disable syntax based folding.");
2347 "Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
2350 "Set this property to 0 to disable folding explicit fold points when fold.comment=1.");
2353 "The string to use for explicit fold start points, replacing the standard //{.");
2356 "The string to use for explicit fold end points, replacing the standard //}.");
2359 "Set this property to 1 to enable explicit fold points anywhere, not just in line comments.");
2408 return osNPRC.PropertyNames();
2416 int SCI_METHOD
PropertySet(
const char *key,
const char *val);
2418 return osNPRC.DescribeWordListSets();
2420 int SCI_METHOD
WordListSet(
int n,
const char *wl);
2421 void SCI_METHOD
Lex(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess);
2422 void SCI_METHOD
Fold(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess);
2444 WordList *wordListN = 0;
2460 std::string words = wl;
2462 if (words.find(
';') != std::string::npos)
2483 int firstModification = -1;
2487 if (*wordListN != wlNew) {
2489 firstModification = 0;
2492 return firstModification;
2495void SCI_METHOD
LexerNPRC::Lex(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess)
2497 LexAccessor styler(pAccess);
2501 StyleContext sc(startPos, length, initStyle, styler);
2503 int curLine = styler.GetLine(startPos);
2504 int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
2505 bool numFloat =
false;
2506 bool numHex =
false;
2507 bool possibleMethod =
false;
2509 for (; sc.More(); sc.Forward()) {
2511 if (sc.atLineStart) {
2512 curLine = styler.GetLine(sc.currentPos);
2513 styler.SetLineState(curLine, curNcLevel);
2533 else if (sc.ch ==
'.' && sc.chNext !=
'.' && !numFloat)
2539 else if (( sc.ch ==
'-' || sc.ch ==
'+' )
2540 && (sc.chPrev ==
'e' || sc.chPrev ==
'E' ))
2545 else if (( sc.ch ==
'e' || sc.ch ==
'E' )
2546 && (sc.chNext ==
'+' || sc.chNext ==
'-' || isdigit(sc.chNext)))
2551 else if (sc.ch ==
'i' && !isdigit(sc.chNext))
2562 if (!
IsWord(sc.ch) && sc.ch !=
'~')
2574 sc.GetCurrent(s,
sizeof(s));
2578 sc.GetCurrentLowered(s,
sizeof(s));
2618 else if (sc.ch ==
'(')
2622 else if (sc.ch ==
'{')
2631 possibleMethod =
false;
2636 if (sc.Match(
'*',
'#')) {
2645 if (sc.atLineStart) {
2652 if (sc.chNext ==
'"' || sc.chNext ==
'\\')
2657 else if (sc.ch ==
'"')
2664 if (sc.ch ==
' ' || sc.ch ==
'(' || sc.atLineStart)
2674 int nCurrentState = sc.state;
2678 while (sc.More() &&
IsWord(sc.ch))
2682 sc.GetCurrent(s,
sizeof(s));
2687 sc.ChangeState(nCurrentState);
2689 sc.SetState(nCurrentState);
2695 if (IsADigit(sc.ch) || (sc.ch ==
'.' && IsADigit(sc.chNext)))
2698 numFloat = sc.ch ==
'.';
2700 else if (sc.ch ==
'.' &&
IsWordStart(
static_cast<char>(sc.chNext)))
2701 possibleMethod =
true;
2706 else if (sc.ch ==
'$')
2710 else if (sc.Match(
"#*!"))
2715 else if (sc.Match(
"##!"))
2720 else if (sc.Match(
'#',
'*'))
2725 else if (sc.Match(
'#',
'#'))
2730 else if (sc.ch ==
'"')
2734 else if (sc.ch ==
'#')
2738 else if (sc.ch ==
'@')
2742 else if (
IsOperator(
static_cast<char>(sc.ch)))
2745 && (sc.Match(
"<wp>") || sc.Match(
"<this>") || sc.Match(
"<loadpath>") || sc.Match(
"<savepath>") || sc.Match(
"<plotpath>") || sc.Match(
"<procpath>") || sc.Match(
"<scriptpath>")))
2749 else if (sc.ch ==
':' && sc.chNext ==
':')
2767void SCI_METHOD
LexerNPRC::Fold(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess)
2773 LexAccessor styler(pAccess);
2775 unsigned int endPos = startPos + length;
2776 int visibleChars = 0;
2777 int lineCurrent = styler.GetLine(startPos);
2778 int levelCurrent = SC_FOLDLEVELBASE;
2779 if (lineCurrent > 0)
2780 levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
2781 int levelMinCurrent = levelCurrent;
2782 int levelNext = levelCurrent;
2783 char chNext = styler[startPos];
2784 int styleNext = styler.StyleAt(startPos);
2785 int style = initStyle;
2787 bool foundElse =
false;
2789 for (
unsigned int i = startPos; i < endPos; i++)
2792 chNext = styler.SafeGetCharAt(i + 1);
2793 int stylePrev = style;
2795 styleNext = styler.StyleAt(i + 1);
2796 bool atEOL = (ch ==
'\r' && chNext !=
'\n') || (ch ==
'\n');
2811 if (userDefinedFoldMarkers)
2824 if ((ch ==
'#') && (chNext ==
'#'))
2826 char chNext2 = styler.SafeGetCharAt(i + 2);
2831 else if (chNext2 ==
'}')
2840 std::string current;
2845 while (styler.StyleAt(n) == style && isgraph(styler.SafeGetCharAt(n)))
2847 current += styler.SafeGetCharAt(n);
2856 else if (styler.SafeGetCharAt(i-1) !=
'd'
2857 && styler.SafeGetCharAt(i-1) !=
'e'
2883 if (atEOL || (i == endPos-1))
2888 nc = styler.GetLineState(lineCurrent);
2889 nc -= lineCurrent>0? styler.GetLineState(lineCurrent-1): 0;
2892 int levelUse = levelCurrent;
2895 levelUse = levelMinCurrent;
2897 int lev = levelUse | levelNext << 16;
2899 lev |= SC_FOLDLEVELWHITEFLAG;
2900 if (levelUse < levelNext || foundElse)
2901 lev |= SC_FOLDLEVELHEADERFLAG;
2902 if (lev != styler.LevelAt(lineCurrent))
2904 styler.SetLevel(lineCurrent, lev);
2907 levelCurrent = levelNext;
2908 levelMinCurrent = levelCurrent;
2963 int SCI_METHOD
PropertySet(
const char *key,
const char *val) {
return 0;}
2968 void SCI_METHOD
Lex(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess);
2969 void SCI_METHOD
Fold(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess) {
return;};
3031#define SCE_TXTADV_POSSIB_URL 20
3032void SCI_METHOD
LexerTXTADV::Lex(
unsigned int startPos,
int length,
int initStyle, IDocument *pAccess)
3034 LexAccessor styler(pAccess);
3038 StyleContext sc(startPos, length, initStyle, styler);
3040 int curLine = styler.GetLine(startPos);
3041 int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0;
3043 for (; sc.More(); sc.Forward()) {
3045 if (sc.atLineStart) {
3046 curLine = styler.GetLine(sc.currentPos);
3047 styler.SetLineState(curLine, curNcLevel);
3063 if (sc.Match(
"***"))
3070 else if (sc.Match(
"**"))
3084 if (sc.Match(
"***"))
3091 else if (sc.Match(
"**"))
3105 if (sc.Match(
"***"))
3112 else if (sc.Match(
"**"))
3132 if (sc.ch ==
' ' || sc.ch ==
'\t' || sc.ch ==
'*' || sc.ch ==
'_' || sc.ch ==
'-' || sc.atLineStart)
3134 else if (sc.Match(
"://"))
3138 if (sc.ch ==
' ' || sc.atLineStart)
3142 if (sc.ch ==
'-' && (sc.chPrev ==
' ' || sc.chNext ==
' '))
3149 if (sc.ch ==
'_' && (sc.chPrev ==
' ' || sc.chNext ==
' '))
3162 if (sc.Match(
"***"))
3169 else if (sc.Match(
"**"))
3181 else if (sc.ch ==
'_' && sc.chPrev ==
' ')
3186 else if (sc.ch ==
'#')
3200 else if (sc.ch ==
'-')
3206 else if (sc.chPrev ==
' ')
3212 else if (isalpha(sc.ch))
static bool IsStreamCommentStyle(int style)
static const char *const emptyWordListDesc[]
static bool IsAlphabetic(int ch)
static bool IsWord(int ch)
LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc)
static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
static void ColouriseDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc)
#define SCE_TXTADV_POSSIB_URL
static bool latexIsBlank(int ch)
static bool latexIsBlankAndNL(int ch)
LexerModule lmNSCR(SCLEX_NSCR, LexerNSCR::LexerFactoryNSCR, "NSCR", NSCRWordLists)
static bool IsBOperator(char ch)
static bool isassignchar(unsigned char ch)
static bool latexNextNotBlankIs(int i, int l, Accessor &styler, char needle)
static bool IsOperator(int ch)
LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", FoldDiffDoc, emptyWordListDesc)
static bool AtEOL(Accessor &styler, unsigned int i)
static void ColouriseErrorListLine(char *lineBuffer, unsigned int lengthLine, unsigned int endPos, Accessor &styler, bool valueSeparate)
static void ColouriseBatchDoc(unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler)
static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
#define DIFF_BUFFER_START_SIZE
static const char *const NSCRWordLists[]
static void ColourisePoDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc)
static bool latexLastWordIs(int start, Accessor &styler, const char *needle)
static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler)
LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc)
static bool Is0To9(char ch)
static bool strstart(const char *haystack, const char *needle)
static bool IsStringSuffix(int ch)
static void ColouriseMakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
LexerModule lmPo(SCLEX_PO, ColourisePoDoc, "po", 0, emptyWordListDesc)
static void ColouriseMakeLine(char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler)
static void FoldPropsDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
static void FoldDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
static void ColourisePropsDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler)
static bool Is1To9(char ch)
static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLine, int &startValue)
static void ColourisePropsLine(char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler, bool allowInitialSpaces)
static const char *const batchWordListDesc[]
LexerModule lmNPRC(SCLEX_NPRC, LexerNPRC::LexerFactoryNPRC, "NPRC", NPRCWordLists)
static void ColourisePoLine(char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler)
static bool latexIsSpecial(int ch)
static bool IsBSeparator(char ch)
LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", FoldPropsDoc, emptyWordListDesc)
static bool latexIsTagValid(int &i, int l, Accessor &styler)
LexerModule lmTXTADV(SCLEX_TXTADV, LexerTXTADV::LexerFactoryTXTADV, "TXTADV", emptyWordListDesc)
static bool latexIsLetter(int ch)
static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler)
static const char *const NPRCWordLists[]
static bool IsWordStart(int ch)
static void ColouriseBatchLine(char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, WordList *keywordlists[], Accessor &styler)
LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null")
#define SCE_NSCR_PROCEDURE_COMMANDS
#define SCE_DIFF_POSITION
#define SCE_TXTADV_BOLD_ITALIC
#define SCE_NPRC_FUNCTION
#define SCE_BAT_IDENTIFIER
#define SCE_NSCR_OPERATOR_KEYWORDS
#define SCE_NSCR_COMMENT_LINE
#define SCE_NPRC_OPERATOR_KEYWORDS
#define SCE_NPRC_COMMENT_BLOCK
#define SCE_NPRC_INCLUDES
#define SCE_NSCR_CONSTANTS
#define SCE_PROPS_DEFAULT
#define SCE_TXTADV_DEFAULT
#define SCE_NPRC_PROCEDURES
#define SCE_TXTADV_MODIFIER
#define SCE_NSCR_PROCEDURES
#define SCE_PROPS_ASSIGNMENT
#define SCE_PROPS_SECTION
#define SCE_D_COMMENTDOCKEYWORDERROR
#define SCE_NSCR_CUSTOM_FUNCTION
#define SCE_NPRC_IDENTIFIER
#define SCE_ERR_DIFF_CHANGED
#define SCE_ERR_DIFF_MESSAGE
#define SCE_NPRC_COMMENT_LINE
#define SCE_NSCR_INCLUDES
#define SCE_NSCR_OPERATORS
#define SCE_MAKE_OPERATOR
#define SCE_NPRC_OPERATORS
#define SCE_NSCR_FUNCTION
#define SCE_NPRC_CUSTOM_FUNCTION
#define SCE_TXTADV_UNDERLINE
#define SCE_PROPS_COMMENT
#define SCE_ERR_DIFF_ADDITION
#define SCE_NSCR_DOCCOMMENT_BLOCK
#define SCE_NSCR_DEFAULT_VARS
#define SCE_NSCR_STRING_PARSER
#define SCE_NSCR_DOCCOMMENT_LINE
#define SCE_TXTADV_BIGHEAD
#define SCE_NPRC_DOCCOMMENT_BLOCK
#define SCE_NPRC_DEFAULT_VARS
#define SCE_NSCR_IDENTIFIER
#define SCE_NPRC_CONSTANTS
#define SCE_ERR_JAVA_STACK
#define SCE_MAKE_IDENTIFIER
#define SCE_TXTADV_STRIKETHROUGH
#define SCE_NPRC_STRING_PARSER
#define SCE_PO_MSGID_TEXT
#define SCE_TXTADV_ITALIC
#define SCE_D_COMMENTDOCKEYWORD
#define SCE_NPRC_DOCKEYWORD
#define SCE_NSCR_DOCKEYWORD
#define SCE_NPRC_DOCCOMMENT_LINE
#define SCE_MAKE_PREPROCESSOR
#define SCE_ERR_DIFF_DELETION
#define SCE_NSCR_COMMENT_BLOCK
#define SCE_PO_MSGCTXT_TEXT
#define SCE_PO_MSGSTR_TEXT
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
const char *SCI_METHOD PropertyNames()
LexerNPRC(bool caseSensitive_)
int SCI_METHOD Version() const
static ILexer * LexerFactoryNPRC()
int SCI_METHOD WordListSet(int n, const char *wl)
void SCI_METHOD Release()
void *SCI_METHOD PrivateCall(int, void *)
static ILexer * LexerFactoryNPRCInsensitive()
const char *SCI_METHOD DescribeProperty(const char *name)
const char *SCI_METHOD DescribeWordListSets()
int SCI_METHOD PropertySet(const char *key, const char *val)
int SCI_METHOD PropertyType(const char *name)
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
static ILexer * LexerFactoryNSCR()
void *SCI_METHOD PrivateCall(int, void *)
static ILexer * LexerFactoryNSCRInsensitive()
int SCI_METHOD PropertyType(const char *name)
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
const char *SCI_METHOD DescribeWordListSets()
int SCI_METHOD PropertySet(const char *key, const char *val)
void SCI_METHOD Release()
LexerNSCR(bool caseSensitive_)
int SCI_METHOD Version() const
const char *SCI_METHOD DescribeProperty(const char *name)
WordList procedureCommandWords
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
const char *SCI_METHOD PropertyNames()
int SCI_METHOD WordListSet(int n, const char *wl)
const char *SCI_METHOD DescribeWordListSets()
void SCI_METHOD Release()
void *SCI_METHOD PrivateCall(int, void *)
void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess)
int SCI_METHOD PropertySet(const char *key, const char *val)
const char *SCI_METHOD PropertyNames()
static ILexer * LexerFactoryTXTADV()
int SCI_METHOD PropertyType(const char *name)
int SCI_METHOD WordListSet(int n, const char *wl)
const char *SCI_METHOD DescribeProperty(const char *name)
int SCI_METHOD Version() const
static ILexer * LexerFactoryTXTADVInsensitive()
LexerTXTADV(bool caseSensitive_)
bool foldExplicitAnywhere
bool foldCommentMultiline
std::string foldExplicitEnd
std::string foldExplicitStart
std::string foldExplicitEnd
bool foldExplicitAnywhere
bool foldCommentMultiline
std::string foldExplicitStart