diff options
author | Matt Gilarde <unknown> | 2017-03-07 12:05:15 +1100 |
---|---|---|
committer | Matt Gilarde <unknown> | 2017-03-07 12:05:15 +1100 |
commit | 996f8a51b5c4138baf95a032e5dc0901c80485f2 (patch) | |
tree | 602d7e2509b38c1974ba51e43758b327dc06c0e3 | |
parent | 069d842392251d56167e08c005d51fa9ccc12147 (diff) | |
download | scintilla-mirror-996f8a51b5c4138baf95a032e5dc0901c80485f2.tar.gz |
Handle nested comments for adjacent markers like "/*/*" or "*/*/".
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | lexers/LexProgress.cxx | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index b48700be2..a8bad7678 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -530,6 +530,10 @@ Lexer added for "indent" language which is styled as plain text but folded by indentation level. </li> <li> + The Progress ABL lexer handles nested comments where comment starts or ends + are adjacent like "/*/*" or "*/*/". + </li> + <li> The VHDL folder folds an "entity" on the first line of the file. </li> <li> diff --git a/lexers/LexProgress.cxx b/lexers/LexProgress.cxx index 84956cd34..c82ca93ca 100644 --- a/lexers/LexProgress.cxx +++ b/lexers/LexProgress.cxx @@ -277,10 +277,15 @@ void SCI_METHOD LexerABL::Lex(Sci_PositionU startPos, Sci_Position length, int i // commentNestingLevel is a non-visible state, used to identify the nesting level of a comment if (checkCommentNestingLevel) { - if (chPrev == '/' && ch == '*') + if (chPrev == '/' && ch == '*') { commentNestingLevel++; + // eat the '/' so we don't miscount a */ if we see /*/* + --back; + } if (chPrev == '*' && ch == '/') { commentNestingLevel--; + // eat the '*' so we don't miscount a /* if we see */*/ + --back; } } --back; |