- enhancement: better highlight processing for preprocess directives
This commit is contained in:
parent
41336cf31f
commit
109ea5a0ae
1
NEWS.md
1
NEWS.md
|
@ -1,6 +1,7 @@
|
|||
Version 0.11.3 For Dev-C++ 7 Beta
|
||||
- fix: use pixel size for fonts, to fit different dpi in multiple displays
|
||||
- enhancement: use the new expression parser to parse info for tips
|
||||
- enhancement: better highlight processing for preprocess directives
|
||||
|
||||
Version 0.11.2 For Dev-C++ 7 Beta
|
||||
- fix: button "run all problem cases" not disabled when compiling or debugging
|
||||
|
|
|
@ -420,28 +420,38 @@ void SynEditCppHighlighter::directiveProc()
|
|||
return;
|
||||
}
|
||||
mTokenId = TokenKind::Directive;
|
||||
do {
|
||||
switch(mLine[mRun].unicode()) {
|
||||
case '/': //comment?
|
||||
switch (mLine[mRun+1].unicode()) {
|
||||
case '/': // is end of directive as well
|
||||
mRun+=1;
|
||||
//skip spaces
|
||||
while (mLine[mRun]!=0 && isSpaceChar(mLine[mRun])) {
|
||||
mRun+=1;
|
||||
}
|
||||
|
||||
while (mLine[mRun]!=0 && isIdentChar(mLine[mRun])) {
|
||||
mRun+=1;
|
||||
}
|
||||
mRange.state = RangeState::rsUnknown;
|
||||
return;
|
||||
case '*': // might be embeded only
|
||||
mRange.state = RangeState::rsDirectiveComment;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case '\\': // yet another line?
|
||||
if (mLine[mRun+1] == 0) {
|
||||
mRun+=1;
|
||||
mRange.state = RangeState::rsMultiLineDirective;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
mRun+=1;
|
||||
} while (mLine[mRun]!=0);
|
||||
// do {
|
||||
// switch(mLine[mRun].unicode()) {
|
||||
// case '/': //comment?
|
||||
// switch (mLine[mRun+1].unicode()) {
|
||||
// case '/': // is end of directive as well
|
||||
// mRange.state = RangeState::rsUnknown;
|
||||
// return;
|
||||
// case '*': // might be embeded only
|
||||
// mRange.state = RangeState::rsDirectiveComment;
|
||||
// return;
|
||||
// }
|
||||
// break;
|
||||
// case '\\': // yet another line?
|
||||
// if (mLine[mRun+1] == 0) {
|
||||
// mRun+=1;
|
||||
// mRange.state = RangeState::rsMultiLineDirective;
|
||||
// return;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// mRun+=1;
|
||||
// } while (mLine[mRun]!=0);
|
||||
}
|
||||
|
||||
void SynEditCppHighlighter::directiveEndProc()
|
||||
|
|
Loading…
Reference in New Issue