From 996f8a51b5c4138baf95a032e5dc0901c80485f2 Mon Sep 17 00:00:00 2001 From: Matt Gilarde Date: Tue, 7 Mar 2017 12:05:15 +1100 Subject: Handle nested comments for adjacent markers like "/*/*" or "*/*/". --- lexers/LexProgress.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lexers') 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; -- cgit v1.2.3