From b3235b1f46dc72b5db566d71aa2bcd2e8ac394a9 Mon Sep 17 00:00:00 2001 From: Piotr Brzozowski Date: Thu, 24 Mar 2022 16:23:51 +0100 Subject: [PATCH 1/2] Fix issue when single line comment is ended by block comment suffix --- translator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translator.go b/translator.go index 38320d8..9710c0d 100644 --- a/translator.go +++ b/translator.go @@ -67,7 +67,7 @@ func translate(s []byte) []byte { i++ continue } - if comment.startted { + if comment.startted && !comment.isSingleLined { if ch == ASTERISK { comment.canEnd = true continue From ed254bd858fe2f5569e3697e1f207ea7c45c2b3d Mon Sep 17 00:00:00 2001 From: Piotr Brzozowski Date: Thu, 24 Mar 2022 16:37:07 +0100 Subject: [PATCH 2/2] Fix issue when comment was ended too soon --- translator.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translator.go b/translator.go index 9710c0d..6bdc89d 100644 --- a/translator.go +++ b/translator.go @@ -67,12 +67,12 @@ func translate(s []byte) []byte { i++ continue } - if comment.startted && !comment.isSingleLined { - if ch == ASTERISK { + if comment.startted { + if ch == ASTERISK && !comment.isSingleLined { comment.canEnd = true continue } - if comment.canEnd && ch == SLASH { + if comment.canEnd && ch == SLASH && !comment.isSingleLined { comment.stop() continue }