Skip to content

Commit

Permalink
Fix empty block comment support
Browse files Browse the repository at this point in the history
Fixes `/**/` being seen as a smart block comment start.
  • Loading branch information
Pieter12345 committed Apr 16, 2024
1 parent 9eaa7aa commit 4b063b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/laytonsmith/core/MethodScriptCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ public static TokenStream lex(String script, Environment env, File file,
buf.append("/*");
inComment = true;
commentIsBlock = true;
if(i < script.length() - 2 && script.charAt(i + 2) == '*') { // "/**".
if(i + 2 < script.length() && script.charAt(i + 2) == '*'
&& (i + 3 >= script.length() || script.charAt(i + 3) != '/')) { // "/**".
inSmartComment = true;
buf.append("*");
i++;
Expand Down

0 comments on commit 4b063b0

Please sign in to comment.