本文整理汇总了C++中Accessor::GetLineState方法的典型用法代码示例。如果您正苦于以下问题:C++ Accessor::GetLineState方法的具体用法?C++ Accessor::GetLineState怎么用?C++ Accessor::GetLineState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accessor
的用法示例。
在下文中一共展示了Accessor::GetLineState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ColouriseDocument
//
// ColouriseDocument
//
static void ColouriseDocument(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
StyleContext sc(startPos, length, initStyle, styler);
int lineCurrent = styler.GetLine(startPos);
bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
while (sc.More()) {
if (sc.atLineEnd) {
// Go to the next line
sc.Forward();
lineCurrent++;
// Remember the line state for future incremental lexing
styler.SetLineState(lineCurrent, apostropheStartsAttribute);
// Don't continue any styles on the next line
sc.SetState(SCE_SPICE_DEFAULT);
}
// Comments
if ((sc.Match('*') && sc.atLineStart) || sc.Match('*','~')) {
ColouriseComment(sc, apostropheStartsAttribute);
// Whitespace
} else if (IsASpace(sc.ch)) {
ColouriseWhiteSpace(sc, apostropheStartsAttribute);
// Delimiters
} else if (IsDelimiterCharacter(sc.ch)) {
ColouriseDelimiter(sc, apostropheStartsAttribute);
// Numbers
} else if (IsADigit(sc.ch) || sc.ch == '#') {
ColouriseNumber(sc, apostropheStartsAttribute);
// Keywords or identifiers
} else {
ColouriseWord(sc, keywords, keywords2, keywords3, apostropheStartsAttribute);
}
}
sc.Complete();
}
示例2: ColouriseLuaDoc
static void ColouriseLuaDoc(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
WordList &keywords7 = *keywordlists[6];
WordList &keywords8 = *keywordlists[7];
// Accepts accented characters
CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
// Not exactly following number definition (several dots are seen as OK, etc.)
// but probably enough in most cases. [pP] is for hex floats.
CharacterSet setNumber(CharacterSet::setDigits, ".-+abcdefpABCDEFP");
CharacterSet setExponent(CharacterSet::setNone, "eEpP");
CharacterSet setLuaOperator(CharacterSet::setNone, "*/-+()={}~[];<>,.^%:#");
CharacterSet setEscapeSkip(CharacterSet::setNone, "\"'\\");
int currentLine = styler.GetLine(startPos);
// Initialize long string [[ ... ]] or block comment --[[ ... ]] nesting level,
// if we are inside such a string. Block comment was introduced in Lua 5.0,
// blocks with separators [=[ ... ]=] in Lua 5.1.
// Continuation of a string (\z whitespace escaping) is controlled by stringWs.
int nestLevel = 0;
int sepCount = 0;
int stringWs = 0;
if (initStyle == SCE_LUA_LITERALSTRING || initStyle == SCE_LUA_COMMENT ||
initStyle == SCE_LUA_STRING || initStyle == SCE_LUA_CHARACTER) {
int lineState = styler.GetLineState(currentLine - 1);
nestLevel = lineState >> 9;
sepCount = lineState & 0xFF;
stringWs = lineState & 0x100;
}
示例3: ColouriseYAMLLine
static void ColouriseYAMLLine(
char *lineBuffer,
unsigned int currentLine,
unsigned int lengthLine,
unsigned int startLine,
unsigned int endPos,
WordList &keywords,
Accessor &styler) {
unsigned int i = 0;
bool bInQuotes = false;
unsigned int indentAmount = SpaceCount(lineBuffer);
if (currentLine > 0) {
int parentLineState = styler.GetLineState(currentLine - 1);
if ((parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT || (parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT_PARENT) {
unsigned int parentIndentAmount = parentLineState&(~YAML_STATE_MASK);
if (indentAmount > parentIndentAmount) {
styler.SetLineState(currentLine, YAML_STATE_TEXT | parentIndentAmount);
styler.ColourTo(endPos, SCE_YAML_TEXT);
return;
}
}
}
styler.SetLineState(currentLine, 0);
if (strncmp(lineBuffer, "---", 3) == 0) { // Document marker
styler.SetLineState(currentLine, YAML_STATE_DOCUMENT);
styler.ColourTo(endPos, SCE_YAML_DOCUMENT);
return;
}
// Skip initial spaces
while ((i < lengthLine) && lineBuffer[i] == ' ') { // YAML always uses space, never TABS or anything else
i++;
}
if (lineBuffer[i] == '\t') { // if we skipped all spaces, and we are NOT inside a text block, this is wrong
styler.ColourTo(endPos, SCE_YAML_ERROR);
return;
}
if (lineBuffer[i] == '#') { // Comment
styler.SetLineState(currentLine, YAML_STATE_COMMENT);
styler.ColourTo(endPos, SCE_YAML_COMMENT);
return;
}
while (i < lengthLine) {
if (lineBuffer[i] == '\'' || lineBuffer[i] == '\"') {
bInQuotes = !bInQuotes;
} else if (lineBuffer[i] == ':' && !bInQuotes) {
styler.ColourTo(startLine + i - 1, SCE_YAML_IDENTIFIER);
styler.ColourTo(startLine + i, SCE_YAML_OPERATOR);
// Non-folding scalar
i++;
while ((i < lengthLine) && isspacechar(lineBuffer[i]))
i++;
unsigned int endValue = lengthLine - 1;
while ((endValue >= i) && isspacechar(lineBuffer[endValue]))
endValue--;
lineBuffer[endValue + 1] = '\0';
if (lineBuffer[i] == '|' || lineBuffer[i] == '>') {
i++;
if (lineBuffer[i] == '+' || lineBuffer[i] == '-')
i++;
while ((i < lengthLine) && isspacechar(lineBuffer[i]))
i++;
if (lineBuffer[i] == '\0') {
styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount);
styler.ColourTo(endPos, SCE_YAML_DEFAULT);
return;
} else if (lineBuffer[i] == '#') {
styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount);
styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT);
styler.ColourTo(endPos, SCE_YAML_COMMENT);
return;
} else {
styler.ColourTo(endPos, SCE_YAML_ERROR);
return;
}
} else if (lineBuffer[i] == '#') {
styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT);
styler.ColourTo(endPos, SCE_YAML_COMMENT);
return;
}
styler.SetLineState(currentLine, YAML_STATE_VALUE);
if (lineBuffer[i] == '&' || lineBuffer[i] == '*') {
styler.ColourTo(endPos, SCE_YAML_REFERENCE);
return;
}
if (keywords.InList(&lineBuffer[i])) { // Convertible value (true/false, etc.)
styler.ColourTo(endPos, SCE_YAML_KEYWORD);
return;
} else {
unsigned int i2 = i;
while ((i < lengthLine) && lineBuffer[i]) {
if (!(isascii(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') {
styler.ColourTo(endPos, SCE_YAML_DEFAULT);
return;
}
i++;
}
if (i > i2) {
//.........这里部分代码省略.........
示例4: Colourise_Doc
// <--- Colourise --->
void Colourise_Doc(unsigned int startPos, unsigned int length, int initStyle, WordList *keywordlists[], Accessor &styler)
{
WordList &keywords0 = *keywordlists[0];
WordList &keywords1 = *keywordlists[1];
WordList &keywords2 = *keywordlists[2];
WordList &keywords3 = *keywordlists[3];
WordList &keywords4 = *keywordlists[4];
WordList &keywords5 = *keywordlists[5];
WordList &keywords6 = *keywordlists[6];
WordList &keywords7 = *keywordlists[7];
WordList &keywords8 = *keywordlists[8];
int currentLine = styler.GetLine(startPos);
int sepCount = 0;
if (initStyle == LITERALSTRING || initStyle == LUA_COMMENT) {
sepCount = styler.GetLineState(currentLine - 1) & 0xFF;
}
// Do not leak onto next line
if (initStyle == STRINGEOL || initStyle == LUA_COMMENTLINE || initStyle == CPP_COMMENTLINE) {
initStyle = DEFAULT;
}
StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward()) {
if (sc.atLineEnd) {
// Update the line state, so it can be seen by next line
currentLine = styler.GetLine(sc.currentPos);
switch (sc.state) {
case LITERALSTRING:
case LUA_COMMENT:
// Inside a literal string or block comment, we set the line state
styler.SetLineState(currentLine, sepCount);
break;
default:
// Reset the line state
styler.SetLineState(currentLine, 0);
break;
}
}
// Handle string line continuation
if ((sc.state == STRING || sc.state == CHARACTER) &&
sc.ch == '\\') {
if (sc.chNext == '\n' || sc.chNext == '\r') {
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
sc.Forward();
}
continue;
}
}
// Determine if the current state should terminate.
if (sc.state == OPERATOR || sc.state == NUMBER) {
sc.SetState(DEFAULT);
} else if (sc.state == IDENTIFIER) {
if (!IsAWordChar(sc.ch) || (sc.currentPos+1 == startPos + length)) {
if (IsAWordChar(sc.ch)) {
sc.Forward(); // Checks words at the end of the document.
}
char s[100];
sc.GetCurrent(s, sizeof(s));
if (keywords0.InList(s)) {
sc.ChangeState(WORD0);
} else if (keywords1.InList(s)) {
sc.ChangeState(WORD1);
} else if (keywords2.InList(s)) {
sc.ChangeState(WORD2);
} else if (keywords5.InList(s)) {
sc.ChangeState(WORD5);
} else if (keywords8.InList(s)) {
sc.ChangeState(WORD8);
}
sc.SetState(DEFAULT);
}
} else if (sc.state == LUA_COMMENTLINE || sc.state == CPP_COMMENTLINE) {
if (sc.atLineEnd) {
sc.ForwardSetState(DEFAULT);
}
} else if (sc.state == STRING) {
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\\') {
sc.Forward();
}
} else if (sc.ch == '\"') {
sc.ForwardSetState(DEFAULT);
} else if (sc.atLineEnd) {
sc.ChangeState(STRINGEOL);
sc.ForwardSetState(DEFAULT);
}
} else if (sc.state == CHARACTER) {
if (sc.ch == '\\') {
if (sc.chNext == '\'' || sc.chNext == '\\') {
sc.Forward();
}
} else if (sc.ch == '\'') {
sc.ForwardSetState(DEFAULT);
} else if (sc.atLineEnd) {
//.........这里部分代码省略.........
示例5: ColouriseEclDoc
//.........这里部分代码省略.........
while ((sc.ch < 0x80) && islower(sc.ch))
sc.Forward(); // gobble regex flags
sc.SetState(SCE_ECL_DEFAULT);
} else if (sc.ch == '\\') {
// Gobble up the quoted character
if (sc.chNext == '\\' || sc.chNext == '/') {
sc.Forward();
}
}
break;
case SCE_ECL_STRINGEOL:
if (sc.atLineStart) {
sc.SetState(SCE_ECL_DEFAULT);
}
break;
case SCE_ECL_VERBATIM:
if (sc.ch == '\"') {
if (sc.chNext == '\"') {
sc.Forward();
} else {
sc.ForwardSetState(SCE_ECL_DEFAULT);
}
}
break;
case SCE_ECL_UUID:
if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') {
sc.SetState(SCE_ECL_DEFAULT);
}
break;
}
// Determine if a new state should be entered.
Sci_Position lineCurrent = styler.GetLine(sc.currentPos);
int lineState = styler.GetLineState(lineCurrent);
if (sc.state == SCE_ECL_DEFAULT) {
if (lineState) {
sc.SetState(lineState);
}
else if (sc.Match('@', '\"')) {
sc.SetState(SCE_ECL_VERBATIM);
sc.Forward();
} else if (setQualified.Contains(sc.ch) && sc.chNext == '\'') {
sc.SetState(SCE_ECL_CHARACTER);
sc.Forward();
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
if (lastWordWasUUID) {
sc.SetState(SCE_ECL_UUID);
lastWordWasUUID = false;
} else {
sc.SetState(SCE_ECL_NUMBER);
}
} else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) {
if (lastWordWasUUID) {
sc.SetState(SCE_ECL_UUID);
lastWordWasUUID = false;
} else {
sc.SetState(SCE_ECL_IDENTIFIER);
}
} else if (sc.Match('/', '*')) {
if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style
sc.SetState(SCE_ECL_COMMENTDOC);
} else {
sc.SetState(SCE_ECL_COMMENT);
}
sc.Forward(); // Eat the * so it isn't used for the end of the comment
} else if (sc.Match('/', '/')) {
示例6: ColouriseTALDoc
static void ColouriseTALDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
styler.StartAt(startPos);
int state = initStyle;
if (state == SCE_C_CHARACTER) // Does not leak onto next line
state = SCE_C_DEFAULT;
char chPrev = ' ';
char chNext = styler[startPos];
unsigned int lengthDoc = startPos + length;
bool bInClassDefinition;
int currentLine = styler.GetLine(startPos);
if (currentLine > 0) {
styler.SetLineState(currentLine, styler.GetLineState(currentLine-1));
bInClassDefinition = (styler.GetLineState(currentLine) == 1);
} else {
styler.SetLineState(currentLine, 0);
bInClassDefinition = false;
}
bool bInAsm = (state == SCE_C_REGEX);
if (bInAsm)
state = SCE_C_DEFAULT;
styler.StartSegment(startPos);
int visibleChars = 0;
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if ((ch == '\r' && chNext != '\n') || (ch == '\n')) {
// Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix)
// Avoid triggering two times on Dos/Win
// End of line
if (state == SCE_C_CHARACTER) {
ColourTo(styler, i, state, bInAsm);
state = SCE_C_DEFAULT;
}
visibleChars = 0;
currentLine++;
styler.SetLineState(currentLine, (bInClassDefinition ? 1 : 0));
}
if (styler.IsLeadByte(ch)) {
chNext = styler.SafeGetCharAt(i + 2);
chPrev = ' ';
i += 1;
continue;
}
if (state == SCE_C_DEFAULT) {
if (isTALwordstart(ch)) {
ColourTo(styler, i-1, state, bInAsm);
state = SCE_C_IDENTIFIER;
} else if (ch == '!' && chNext != '*') {
ColourTo(styler, i-1, state, bInAsm);
state = SCE_C_COMMENT;
} else if (ch == '!' && chNext == '*') {
ColourTo(styler, i-1, state, bInAsm);
state = SCE_C_COMMENTDOC;
} else if (ch == '-' && chNext == '-') {
ColourTo(styler, i-1, state, bInAsm);
state = SCE_C_COMMENTLINE;
} else if (ch == '"') {
ColourTo(styler, i-1, state, bInAsm);
state = SCE_C_STRING;
} else if (ch == '?' && visibleChars == 0) {
ColourTo(styler, i-1, state, bInAsm);
state = SCE_C_PREPROCESSOR;
} else if (isTALoperator(ch)) {
ColourTo(styler, i-1, state, bInAsm);
ColourTo(styler, i, SCE_C_OPERATOR, bInAsm);
}
} else if (state == SCE_C_IDENTIFIER) {
if (!isTALwordchar(ch)) {
int lStateChange = classifyWordTAL(styler.GetStartSegment(), i - 1, keywordlists, styler, bInAsm);
if(lStateChange == 1) {
styler.SetLineState(currentLine, 1);
bInClassDefinition = true;
} else if(lStateChange == 2) {
bInAsm = true;
} else if(lStateChange == -1) {
styler.SetLineState(currentLine, 0);
bInClassDefinition = false;
bInAsm = false;
}
state = SCE_C_DEFAULT;
chNext = styler.SafeGetCharAt(i + 1);
if (ch == '!' && chNext != '*') {
state = SCE_C_COMMENT;
} else if (ch == '!' && chNext == '*') {
ColourTo(styler, i-1, state, bInAsm);
state = SCE_C_COMMENTDOC;
} else if (ch == '-' && chNext == '-') {
//.........这里部分代码省略.........
示例7: FoldPascalDoc
static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, WordList *[],
Accessor &styler) {
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
unsigned int endPos = startPos + length;
int visibleChars = 0;
int lineCurrent = styler.GetLine(startPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
int lineFoldStateCurrent = lineCurrent > 0 ? styler.GetLineState(lineCurrent - 1) & stateFoldMaskAll : 0;
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
int lastStart = 0;
CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
if (foldComment && IsStreamCommentStyle(style)) {
if (!IsStreamCommentStyle(stylePrev)) {
levelCurrent++;
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
// Comments don't end at end of line and the next character may be unstyled.
levelCurrent--;
}
}
if (foldComment && atEOL && IsCommentLine(lineCurrent, styler))
{
if (!IsCommentLine(lineCurrent - 1, styler)
&& IsCommentLine(lineCurrent + 1, styler))
levelCurrent++;
else if (IsCommentLine(lineCurrent - 1, styler)
&& !IsCommentLine(lineCurrent+1, styler))
levelCurrent--;
}
if (foldPreprocessor) {
if (style == SCE_PAS_PREPROCESSOR && ch == '{' && chNext == '$') {
ClassifyPascalPreprocessorFoldPoint(levelCurrent, lineFoldStateCurrent, i + 2, styler);
} else if (style == SCE_PAS_PREPROCESSOR2 && ch == '(' && chNext == '*'
&& styler.SafeGetCharAt(i + 2) == '$') {
ClassifyPascalPreprocessorFoldPoint(levelCurrent, lineFoldStateCurrent, i + 3, styler);
}
}
if (stylePrev != SCE_PAS_WORD && style == SCE_PAS_WORD)
{
// Store last word start point.
lastStart = i;
}
if (stylePrev == SCE_PAS_WORD && !(lineFoldStateCurrent & stateFoldInPreprocessor)) {
if(setWord.Contains(ch) && !setWord.Contains(chNext)) {
ClassifyPascalWordFoldPoint(levelCurrent, lineFoldStateCurrent, startPos, endPos, lastStart, i, styler);
}
}
if (!IsASpace(ch))
visibleChars++;
if (atEOL) {
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
if ((levelCurrent > levelPrev) && (visibleChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent)) {
styler.SetLevel(lineCurrent, lev);
}
int newLineState = (styler.GetLineState(lineCurrent) & ~stateFoldMaskAll) | lineFoldStateCurrent;
styler.SetLineState(lineCurrent, newLineState);
lineCurrent++;
levelPrev = levelCurrent;
visibleChars = 0;
}
}
// If we didn't reach the EOL in previous loop, store line level and whitespace information.
// The rest will be filled in later...
int lev = levelPrev;
if (visibleChars == 0 && foldCompact)
lev |= SC_FOLDLEVELWHITEFLAG;
styler.SetLevel(lineCurrent, lev);
}
示例8: ColourisePascalDoc
static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
bool bSmartHighlighting = styler.GetPropertyInt("lexer.pascal.smart.highlighting", 1) != 0;
CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true);
CharacterSet setNumber(CharacterSet::setDigits, ".-+eE");
CharacterSet setHexNumber(CharacterSet::setDigits, "abcdefABCDEF");
CharacterSet setOperator(CharacterSet::setNone, "#$&'()*+,-./:;<=>@[]^{}");
int curLine = styler.GetLine(startPos);
int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : 0;
StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward()) {
if (sc.atLineEnd) {
// Update the line state, so it can be seen by next line
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, curLineState);
}
// Determine if the current state should terminate.
switch (sc.state) {
case SCE_PAS_NUMBER:
if (!setNumber.Contains(sc.ch) || (sc.ch == '.' && sc.chNext == '.')) {
sc.SetState(SCE_PAS_DEFAULT);
} else if (sc.ch == '-' || sc.ch == '+') {
if (sc.chPrev != 'E' && sc.chPrev != 'e') {
sc.SetState(SCE_PAS_DEFAULT);
}
}
break;
case SCE_PAS_IDENTIFIER:
if (!setWord.Contains(sc.ch)) {
ClassifyPascalWord(keywordlists, sc, curLineState, bSmartHighlighting);
}
break;
case SCE_PAS_HEXNUMBER:
if (!setHexNumber.Contains(sc.ch)) {
sc.SetState(SCE_PAS_DEFAULT);
}
break;
case SCE_PAS_COMMENT:
case SCE_PAS_PREPROCESSOR:
if (sc.ch == '}') {
sc.ForwardSetState(SCE_PAS_DEFAULT);
}
break;
case SCE_PAS_COMMENT2:
case SCE_PAS_PREPROCESSOR2:
if (sc.Match('*', ')')) {
sc.Forward();
sc.ForwardSetState(SCE_PAS_DEFAULT);
}
break;
case SCE_PAS_COMMENTLINE:
if (sc.atLineStart) {
sc.SetState(SCE_PAS_DEFAULT);
}
break;
case SCE_PAS_STRING:
if (sc.atLineEnd) {
sc.ChangeState(SCE_PAS_STRINGEOL);
} else if (sc.ch == '\'' && sc.chNext == '\'') {
sc.Forward();
} else if (sc.ch == '\'') {
sc.ForwardSetState(SCE_PAS_DEFAULT);
}
break;
case SCE_PAS_STRINGEOL:
if (sc.atLineStart) {
sc.SetState(SCE_PAS_DEFAULT);
}
break;
case SCE_PAS_CHARACTER:
if (!setHexNumber.Contains(sc.ch) && sc.ch != '$') {
sc.SetState(SCE_PAS_DEFAULT);
}
break;
case SCE_PAS_OPERATOR:
if (bSmartHighlighting && sc.chPrev == ';') {
curLineState &= ~(stateInProperty | stateInExport);
}
sc.SetState(SCE_PAS_DEFAULT);
break;
case SCE_PAS_ASM:
sc.SetState(SCE_PAS_DEFAULT);
break;
}
// Determine if a new state should be entered.
if (sc.state == SCE_PAS_DEFAULT) {
if (IsADigit(sc.ch) && !(curLineState & stateInAsm)) {
sc.SetState(SCE_PAS_NUMBER);
} else if (setWordStart.Contains(sc.ch)) {
sc.SetState(SCE_PAS_IDENTIFIER);
} else if (sc.ch == '$' && !(curLineState & stateInAsm)) {
sc.SetState(SCE_PAS_HEXNUMBER);
} else if (sc.Match('{', '$')) {
//.........这里部分代码省略.........
示例9: ColorizeHaskellDoc
static void ColorizeHaskellDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &ffi = *keywordlists[1];
StyleContext sc(startPos, length, initStyle, styler);
int lineCurrent = styler.GetLine(startPos);
int state = lineCurrent ? styler.GetLineState(lineCurrent-1)
: HA_MODE_DEFAULT;
int mode = state & 0xF;
int xmode = state >> 4;
while (sc.More()) {
// Check for state end
// Operator
if (sc.state == SCE_HA_OPERATOR) {
if (isascii(sc.ch) && isoperator(static_cast<char>(sc.ch))) {
sc.Forward();
} else {
styler.ColourTo(sc.currentPos - 1, sc.state);
sc.ChangeState(SCE_HA_DEFAULT);
}
}
// String
else if (sc.state == SCE_HA_STRING) {
if (sc.ch == '\"') {
sc.Forward();
styler.ColourTo(sc.currentPos-1, sc.state);
sc.ChangeState(SCE_HA_DEFAULT);
} else if (sc.ch == '\\') {
sc.Forward(2);
} else if (sc.atLineEnd) {
styler.ColourTo(sc.currentPos-1, sc.state);
sc.ChangeState(SCE_HA_DEFAULT);
} else {
sc.Forward();
}
}
// Char
else if (sc.state == SCE_HA_CHARACTER) {
if (sc.ch == '\'') {
sc.Forward();
styler.ColourTo(sc.currentPos-1, sc.state);
sc.ChangeState(SCE_HA_DEFAULT);
} else if (sc.ch == '\\') {
sc.Forward(2);
} else if (sc.atLineEnd) {
styler.ColourTo(sc.currentPos-1, sc.state);
sc.ChangeState(SCE_HA_DEFAULT);
} else {
sc.Forward();
}
}
// Number
else if (sc.state == SCE_HA_NUMBER) {
if (IsADigit(sc.ch, xmode)) {
sc.Forward();
} else if ((xmode == 10) &&
(sc.ch == 'e' || sc.ch == 'E') &&
(IsADigit(sc.chNext) || sc.chNext == '+' || sc.chNext == '-')) {
sc.Forward();
if (sc.ch == '+' || sc.ch == '-')
sc.Forward();
} else {
styler.ColourTo(sc.currentPos - 1, sc.state);
sc.ChangeState(SCE_HA_DEFAULT);
}
}
// Identifier
else if (sc.state == SCE_HA_IDENTIFIER) {
if (IsAWordChar(sc.ch)) {
sc.Forward();
} else {
char s[100];
sc.GetCurrent(s, sizeof(s));
int style = sc.state;
int new_mode = 0;
if (keywords.InList(s)) {
style = SCE_HA_KEYWORD;
} else if (isupper(s[0])) {
if (mode >= HA_MODE_IMPORT1 && mode <= HA_MODE_IMPORT3) {
style = SCE_HA_MODULE;
new_mode = HA_MODE_IMPORT2;
} else if (mode == HA_MODE_MODULE)
style = SCE_HA_MODULE;
else
style = SCE_HA_CAPITAL;
} else if (mode == HA_MODE_IMPORT1 &&
strcmp(s,"qualified") == 0) {
style = SCE_HA_KEYWORD;
new_mode = HA_MODE_IMPORT1;
} else if (mode == HA_MODE_IMPORT2) {
if (strcmp(s,"as") == 0) {
style = SCE_HA_KEYWORD;
new_mode = HA_MODE_IMPORT3;
} else if (strcmp(s,"hiding") == 0) {
style = SCE_HA_KEYWORD;
//.........这里部分代码省略.........
示例10: ColouriseRebolDoc
static void ColouriseRebolDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5];
WordList &keywords7 = *keywordlists[6];
WordList &keywords8 = *keywordlists[7];
int currentLine = styler.GetLine(startPos);
// Initialize the braced string {.. { ... } ..} nesting level, if we are inside such a string.
int stringLevel = 0;
if (initStyle == SCE_REBOL_BRACEDSTRING || initStyle == SCE_REBOL_COMMENTBLOCK) {
stringLevel = styler.GetLineState(currentLine - 1);
}
bool blockComment = initStyle == SCE_REBOL_COMMENTBLOCK;
int dotCount = 0;
// Do not leak onto next line
if (initStyle == SCE_REBOL_COMMENTLINE) {
initStyle = SCE_REBOL_DEFAULT;
}
StyleContext sc(startPos, length, initStyle, styler);
if (startPos == 0) {
sc.SetState(SCE_REBOL_PREFACE);
}
for (; sc.More(); sc.Forward()) {
//--- What to do at line end ?
if (sc.atLineEnd) {
// Can be either inside a {} string or simply at eol
if (sc.state != SCE_REBOL_BRACEDSTRING && sc.state != SCE_REBOL_COMMENTBLOCK &&
sc.state != SCE_REBOL_BINARY && sc.state != SCE_REBOL_PREFACE)
sc.SetState(SCE_REBOL_DEFAULT);
// Update the line state, so it can be seen by next line
currentLine = styler.GetLine(sc.currentPos);
switch (sc.state) {
case SCE_REBOL_BRACEDSTRING:
case SCE_REBOL_COMMENTBLOCK:
// Inside a braced string, we set the line state
styler.SetLineState(currentLine, stringLevel);
break;
default:
// Reset the line state
styler.SetLineState(currentLine, 0);
break;
}
// continue with next char
continue;
}
//--- What to do on white-space ?
if (IsASpaceOrTab(sc.ch))
{
// Return to default if any of these states
if (sc.state == SCE_REBOL_OPERATOR || sc.state == SCE_REBOL_CHARACTER ||
sc.state == SCE_REBOL_NUMBER || sc.state == SCE_REBOL_PAIR ||
sc.state == SCE_REBOL_TUPLE || sc.state == SCE_REBOL_FILE ||
sc.state == SCE_REBOL_DATE || sc.state == SCE_REBOL_TIME ||
sc.state == SCE_REBOL_MONEY || sc.state == SCE_REBOL_ISSUE ||
sc.state == SCE_REBOL_URL || sc.state == SCE_REBOL_EMAIL) {
sc.SetState(SCE_REBOL_DEFAULT);
}
}
//--- Specialize state ?
// URL, Email look like identifier
if (sc.state == SCE_REBOL_IDENTIFIER)
{
if (sc.ch == ':' && !IsASpace(sc.chNext)) {
sc.ChangeState(SCE_REBOL_URL);
} else if (sc.ch == '@') {
sc.ChangeState(SCE_REBOL_EMAIL);
} else if (sc.ch == '$') {
sc.ChangeState(SCE_REBOL_MONEY);
}
}
// Words look like identifiers
if (sc.state == SCE_REBOL_IDENTIFIER || (sc.state >= SCE_REBOL_WORD && sc.state <= SCE_REBOL_WORD8)) {
// Keywords ?
if (!IsAWordChar(sc.ch) || sc.Match('/')) {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
blockComment = strcmp(s, "comment") == 0;
if (keywords8.InList(s)) {
sc.ChangeState(SCE_REBOL_WORD8);
} else if (keywords7.InList(s)) {
sc.ChangeState(SCE_REBOL_WORD7);
} else if (keywords6.InList(s)) {
sc.ChangeState(SCE_REBOL_WORD6);
} else if (keywords5.InList(s)) {
sc.ChangeState(SCE_REBOL_WORD5);
} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_REBOL_WORD4);
//.........这里部分代码省略.........
示例11: ColouriseDocument
static void ColouriseDocument(
Sci_PositionU startPos,
Sci_Position length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords = *keywordlists[0];
StyleContext sc(startPos, length, initStyle, styler);
Sci_Position lineCurrent = styler.GetLine(startPos);
bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0;
while (sc.More()) {
if (sc.atLineEnd) {
// Go to the next line
sc.Forward();
lineCurrent++;
// Remember the line state for future incremental lexing
styler.SetLineState(lineCurrent, apostropheStartsAttribute);
// Don't continue any styles on the next line
sc.SetState(SCE_ADA_DEFAULT);
}
// Comments
if (sc.Match('-', '-')) {
ColouriseComment(sc, apostropheStartsAttribute);
// Strings
} else if (sc.Match('"')) {
ColouriseString(sc, apostropheStartsAttribute);
// Characters
} else if (sc.Match('\'') && !apostropheStartsAttribute) {
ColouriseCharacter(sc, apostropheStartsAttribute);
// Labels
} else if (sc.Match('<', '<')) {
ColouriseLabel(sc, keywords, apostropheStartsAttribute);
// Whitespace
} else if (IsASpace(sc.ch)) {
ColouriseWhiteSpace(sc, apostropheStartsAttribute);
// Delimiters
} else if (IsDelimiterCharacter(sc.ch)) {
ColouriseDelimiter(sc, apostropheStartsAttribute);
// Numbers
} else if (IsADigit(sc.ch) || sc.ch == '#') {
ColouriseNumber(sc, apostropheStartsAttribute);
// Keywords or identifiers
} else {
ColouriseWord(sc, keywords, apostropheStartsAttribute);
}
}
sc.Complete();
}
示例12: ColourisePSDoc
static void ColourisePSDoc(
unsigned int startPos,
int length,
int initStyle,
WordList *keywordlists[],
Accessor &styler) {
WordList &keywords1 = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
WordList &keywords3 = *keywordlists[2];
WordList &keywords4 = *keywordlists[3];
WordList &keywords5 = *keywordlists[4];
StyleContext sc(startPos, length, initStyle, styler);
bool tokenizing = styler.GetPropertyInt("ps.tokenize") != 0;
int pslevel = styler.GetPropertyInt("ps.level", 3);
int lineCurrent = styler.GetLine(startPos);
int nestTextCurrent = 0;
if (lineCurrent > 0 && initStyle == SCE_PS_TEXT)
nestTextCurrent = styler.GetLineState(lineCurrent - 1);
int numRadix = 0;
bool numHasPoint = false;
bool numHasExponent = false;
bool numHasSign = false;
// Clear out existing tokenization
if (tokenizing && length > 0) {
styler.StartAt(startPos, static_cast<char>(INDIC2_MASK));
styler.ColourTo(startPos + length-1, 0);
styler.Flush();
styler.StartAt(startPos);
styler.StartSegment(startPos);
}
for (; sc.More(); sc.Forward()) {
if (sc.atLineStart)
lineCurrent = styler.GetLine(sc.currentPos);
// Determine if the current state should terminate.
if (sc.state == SCE_PS_COMMENT || sc.state == SCE_PS_DSC_VALUE) {
if (sc.atLineEnd) {
sc.SetState(SCE_C_DEFAULT);
}
} else if (sc.state == SCE_PS_DSC_COMMENT) {
if (sc.ch == ':') {
sc.Forward();
if (!sc.atLineEnd)
sc.SetState(SCE_PS_DSC_VALUE);
else
sc.SetState(SCE_C_DEFAULT);
} else if (sc.atLineEnd) {
sc.SetState(SCE_C_DEFAULT);
} else if (IsAWhitespaceChar(sc.ch) && sc.ch != '\r') {
sc.ChangeState(SCE_PS_COMMENT);
}
} else if (sc.state == SCE_PS_NUMBER) {
if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch)) {
if ((sc.chPrev == '+' || sc.chPrev == '-' ||
sc.chPrev == 'E' || sc.chPrev == 'e') && numRadix == 0)
sc.ChangeState(SCE_PS_NAME);
sc.SetState(SCE_C_DEFAULT);
} else if (sc.ch == '#') {
if (numHasPoint || numHasExponent || numHasSign || numRadix != 0) {
sc.ChangeState(SCE_PS_NAME);
} else {
char szradix[5];
sc.GetCurrent(szradix, 4);
numRadix = atoi(szradix);
if (numRadix < 2 || numRadix > 36)
sc.ChangeState(SCE_PS_NAME);
}
} else if ((sc.ch == 'E' || sc.ch == 'e') && numRadix == 0) {
if (numHasExponent) {
sc.ChangeState(SCE_PS_NAME);
} else {
numHasExponent = true;
if (sc.chNext == '+' || sc.chNext == '-')
sc.Forward();
}
} else if (sc.ch == '.') {
if (numHasPoint || numHasExponent || numRadix != 0) {
sc.ChangeState(SCE_PS_NAME);
} else {
numHasPoint = true;
}
} else if (numRadix == 0) {
if (!IsABaseNDigit(sc.ch, 10))
sc.ChangeState(SCE_PS_NAME);
} else {
if (!IsABaseNDigit(sc.ch, numRadix))
sc.ChangeState(SCE_PS_NAME);
}
} else if (sc.state == SCE_PS_NAME || sc.state == SCE_PS_KEYWORD) {
if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch)) {
char s[100];
sc.GetCurrent(s, sizeof(s));
if ((pslevel >= 1 && keywords1.InList(s)) ||
(pslevel >= 2 && keywords2.InList(s)) ||
(pslevel >= 3 && keywords3.InList(s)) ||
//.........这里部分代码省略.........
示例13: ColouriseBashDoc
//.........这里部分代码省略.........
Depth++;
Count = 1;
Up = u;
Down = opposite(Up);
Style = s;
}
void Pop(void) {
if (Depth <= 0)
return;
Depth--;
Count = CountStack[Depth];
Up = UpStack [Depth];
Style = StyleStack[Depth];
Down = opposite(Up);
}
~QuoteStackCls() {
}
};
QuoteStackCls QuoteStack;
int numBase = 0;
int digit;
Sci_PositionU endPos = startPos + length;
int cmdState = BASH_CMD_START;
int testExprType = 0;
// Always backtracks to the start of a line that is not a continuation
// of the previous line (i.e. start of a bash command segment)
Sci_Position ln = styler.GetLine(startPos);
if (ln > 0 && startPos == static_cast<Sci_PositionU>(styler.LineStart(ln)))
ln--;
for (;;) {
startPos = styler.LineStart(ln);
if (ln == 0 || styler.GetLineState(ln) == BASH_CMD_START)
break;
ln--;
}
initStyle = SCE_SH_DEFAULT;
StyleContext sc(startPos, endPos - startPos, initStyle, styler);
for (; sc.More(); sc.Forward()) {
// handle line continuation, updates per-line stored state
if (sc.atLineStart) {
ln = styler.GetLine(sc.currentPos);
if (sc.state == SCE_SH_STRING
|| sc.state == SCE_SH_BACKTICKS
|| sc.state == SCE_SH_CHARACTER
|| sc.state == SCE_SH_HERE_Q
|| sc.state == SCE_SH_COMMENTLINE
|| sc.state == SCE_SH_PARAM) {
// force backtrack while retaining cmdState
styler.SetLineState(ln, BASH_CMD_BODY);
} else {
if (ln > 0) {
if ((sc.GetRelative(-3) == '\\' && sc.GetRelative(-2) == '\r' && sc.chPrev == '\n')
|| sc.GetRelative(-2) == '\\') { // handle '\' line continuation
// retain last line's state
} else
cmdState = BASH_CMD_START;
}
styler.SetLineState(ln, cmdState);
}
}
示例14: ColouriseMatlabOctaveDoc
static void ColouriseMatlabOctaveDoc(
unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler,
bool (*IsCommentChar)(int)) {
WordList &keywords = *keywordlists[0];
styler.StartAt(startPos);
// boolean for when the ' is allowed to be transpose vs the start/end
// of a string
bool transpose = false;
// approximate position of first non space character in a line
int nonSpaceColumn = -1;
// approximate column position of the current character in a line
int column = 0;
// use the line state of each line to store the block comment depth
int curLine = styler.GetLine(startPos);
int commentDepth = curLine > 0 ? styler.GetLineState(curLine-1) : 0;
StyleContext sc(startPos, length, initStyle, styler);
for (; sc.More(); sc.Forward(), column++) {
if(sc.atLineStart) {
// set the line state to the current commentDepth
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
// reset the column to 0, nonSpace to -1 (not set)
column = 0;
nonSpaceColumn = -1;
}
// save the column position of first non space character in a line
if((nonSpaceColumn == -1) && (! IsASpace(sc.ch)))
{
nonSpaceColumn = column;
}
// check for end of states
if (sc.state == SCE_MATLAB_OPERATOR) {
if (sc.chPrev == '.') {
if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') {
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
transpose = false;
} else if (sc.ch == '\'') {
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
transpose = true;
} else if(sc.ch == '.' && sc.chNext == '.') {
// we werent an operator, but a '...'
sc.ChangeState(SCE_MATLAB_COMMENT);
transpose = false;
} else {
sc.SetState(SCE_MATLAB_DEFAULT);
}
} else {
sc.SetState(SCE_MATLAB_DEFAULT);
}
} else if (sc.state == SCE_MATLAB_KEYWORD) {
if (!isalnum(sc.ch) && sc.ch != '_') {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (keywords.InList(s)) {
sc.SetState(SCE_MATLAB_DEFAULT);
transpose = false;
} else {
sc.ChangeState(SCE_MATLAB_IDENTIFIER);
sc.SetState(SCE_MATLAB_DEFAULT);
transpose = true;
}
}
} else if (sc.state == SCE_MATLAB_NUMBER) {
if (!isdigit(sc.ch) && sc.ch != '.'
&& !(sc.ch == 'e' || sc.ch == 'E')
&& !((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E'))) {
sc.SetState(SCE_MATLAB_DEFAULT);
transpose = true;
}
} else if (sc.state == SCE_MATLAB_STRING) {
if (sc.ch == '\'') {
if (sc.chNext == '\'') {
sc.Forward();
} else {
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
}
}
} else if (sc.state == SCE_MATLAB_DOUBLEQUOTESTRING) {
if (sc.ch == '\\') {
if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
sc.Forward();
}
} else if (sc.ch == '\"') {
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
}
} else if (sc.state == SCE_MATLAB_COMMAND) {
if (sc.atLineEnd) {
//.........这里部分代码省略.........
示例15: sc
static void ColouriseTADS3Doc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
int visibleChars = 0;
int bracketLevel = 0;
int lineState = 0;
unsigned int endPos = startPos + length;
int lineCurrent = styler.GetLine(startPos);
if (lineCurrent > 0) {
lineState = styler.GetLineState(lineCurrent-1);
}
StyleContext sc(startPos, length, initStyle, styler);
while (sc.More()) {
if (IsEOL(sc.ch, sc.chNext)) {
styler.SetLineState(lineCurrent, lineState);
lineCurrent++;
visibleChars = 0;
sc.Forward();
if (sc.ch == '\n') {
sc.Forward();
}
}
switch(sc.state) {
case SCE_T3_PREPROCESSOR:
case SCE_T3_LINE_COMMENT:
ColouriseToEndOfLine(sc, sc.state, lineState&T3_INT_EXPRESSION ?
SCE_T3_X_DEFAULT : SCE_T3_DEFAULT);
break;
case SCE_T3_S_STRING:
case SCE_T3_D_STRING:
case SCE_T3_X_STRING:
ColouriseTADS3String(sc, lineState);
visibleChars++;
break;
case SCE_T3_MSG_PARAM:
ColouriseTADS3MsgParam(sc, lineState);
break;
case SCE_T3_LIB_DIRECTIVE:
ColouriseTADS3LibDirective(sc, lineState);
break;
case SCE_T3_HTML_DEFAULT:
ColouriseTADS3HTMLTag(sc, lineState);
break;
case SCE_T3_HTML_STRING:
ColouriseTADSHTMLString(sc, lineState);
break;
case SCE_T3_BLOCK_COMMENT:
ColouriseTADS3Comment(sc, lineState&T3_INT_EXPRESSION ?
SCE_T3_X_DEFAULT : SCE_T3_DEFAULT);
break;
case SCE_T3_DEFAULT:
case SCE_T3_X_DEFAULT:
if (IsASpaceOrTab(sc.ch)) {
sc.Forward();
} else if (sc.ch == '#' && visibleChars == 0) {
ColouriseToEndOfLine(sc, SCE_T3_PREPROCESSOR, sc.state);
} else if (sc.Match('/', '*')) {
ColouriseTADS3Comment(sc, sc.state);
visibleChars++;
} else if (sc.Match('/', '/')) {
ColouriseToEndOfLine(sc, SCE_T3_LINE_COMMENT, sc.state);
} else if (sc.ch == '"') {
bracketLevel = 0;
ColouriseTADS3String(sc, lineState);
visibleChars++;
} else if (sc.ch == '\'') {
ColouriseTADS3String(sc, lineState);
visibleChars++;
} else if (sc.state == SCE_T3_X_DEFAULT && bracketLevel == 0
&& sc.Match('>', '>')) {
sc.Forward(2);
sc.SetState(SCE_T3_D_STRING);
if (lineState & T3_INT_EXPRESSION_IN_TAG)
sc.SetState(SCE_T3_HTML_STRING);
lineState &= ~(T3_SINGLE_QUOTE|T3_INT_EXPRESSION
|T3_INT_EXPRESSION_IN_TAG);
} else if (IsATADS3Operator(sc.ch)) {
if (sc.state == SCE_T3_X_DEFAULT) {
if (sc.ch == '(') {
bracketLevel++;
} else if (sc.ch == ')' && bracketLevel > 0) {
bracketLevel--;
}
}
ColouriseTADS3Operator(sc);
visibleChars++;
} else if (IsANumberStart(sc)) {
ColouriseTADS3Number(sc);
visibleChars++;
} else if (IsAWordStart(sc.ch)) {
ColouriseTADS3Keyword(sc, keywordlists, endPos);
visibleChars++;
} else if (sc.Match("...")) {
sc.SetState(SCE_T3_IDENTIFIER);
sc.Forward(3);
sc.SetState(SCE_T3_DEFAULT);
} else {
sc.Forward();
//.........这里部分代码省略.........