diff --git a/DevTools/HackStudio/CppLexer.cpp b/DevTools/HackStudio/CppLexer.cpp index d9b5744ba1..e92bdfb488 100644 --- a/DevTools/HackStudio/CppLexer.cpp +++ b/DevTools/HackStudio/CppLexer.cpp @@ -278,13 +278,21 @@ Vector CppLexer::lex() begin_token(); consume(); consume(); + bool comment_block_ends = false; while (peek()) { - if (peek() == '*' && peek(1) == '/') + if (peek() == '*' && peek(1) == '/') { + comment_block_ends = true; break; + } + consume(); } - consume(); - consume(); + + if (comment_block_ends) { + consume(); + consume(); + } + commit_token(CppToken::Type::Comment); continue; }