Minor clean up for #384.

This commit is contained in:
A Pottinger
2022-01-29 20:21:22 -08:00
parent 00fbc6974d
commit 077e6741f7
3 changed files with 11 additions and 3 deletions
@@ -957,7 +957,7 @@ public class PreprocService {
static {
Map<String, String> compilerOptions = new HashMap<>();
// TODO: VERSION_17 if using new language features
// TODO: VERSION_17 if using new language features. Requires new JDT.
compilerOptions.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_11);
compilerOptions.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_11);
compilerOptions.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_11);
@@ -330,7 +330,7 @@ public class SourceUtil {
} else {
// Exiting block
int blockEnd = i;
if (prevState == IN_BLOCK_COMMENT && i < length) blockEnd--;
if (prevState == IN_BLOCK_COMMENT && i < length) blockEnd--; // preserve star in '*/'
for (int j = blockStart; j < blockEnd; j++) {
char c = p.charAt(j);
if (c != '\n' && c != '\r') p.setCharAt(j, ' ');
@@ -317,7 +317,15 @@ public class PdeParseTreeListener extends ProcessingBaseListener {
footerResult = prepareFooter(rewriter, length);
}
@Override
/**
* Detect if the user is programming with "mixed" modes.
*
* <p>Detect if the user is programming with "mixed" modes where they are
* combining active and static mode features. This may be, for example, a
* method call followed by method definition.</p>
*
* @param ctx The context from ANTLR for the mixed modes sketch.
*/
public void enterWarnMixedModes(ProcessingParser.WarnMixedModesContext ctx) {
pdeParseTreeErrorListenerMaybe.ifPresent((listener) -> {
Token token = ctx.getStart();