Skip to content

Commit 077e674

Browse files
committed
Minor clean up for processing#384.
1 parent 00fbc69 commit 077e674

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

java/src/processing/mode/java/PreprocService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ private static boolean checkIfImportsChanged(List<ImportStatement> prevImports,
957957
static {
958958
Map<String, String> compilerOptions = new HashMap<>();
959959

960-
// TODO: VERSION_17 if using new language features
960+
// TODO: VERSION_17 if using new language features. Requires new JDT.
961961
compilerOptions.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_11);
962962
compilerOptions.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_11);
963963
compilerOptions.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_11);

java/src/processing/mode/java/SourceUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static public void scrubCommentsAndStrings(StringBuilder p) {
330330
} else {
331331
// Exiting block
332332
int blockEnd = i;
333-
if (prevState == IN_BLOCK_COMMENT && i < length) blockEnd--;
333+
if (prevState == IN_BLOCK_COMMENT && i < length) blockEnd--; // preserve star in '*/'
334334
for (int j = blockStart; j < blockEnd; j++) {
335335
char c = p.charAt(j);
336336
if (c != '\n' && c != '\r') p.setCharAt(j, ' ');

java/src/processing/mode/java/preproc/PdeParseTreeListener.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,15 @@ public void exitProcessingSketch(ProcessingParser.ProcessingSketchContext ctx) {
317317
footerResult = prepareFooter(rewriter, length);
318318
}
319319

320-
@Override
320+
/**
321+
* Detect if the user is programming with "mixed" modes.
322+
*
323+
* <p>Detect if the user is programming with "mixed" modes where they are
324+
* combining active and static mode features. This may be, for example, a
325+
* method call followed by method definition.</p>
326+
*
327+
* @param ctx The context from ANTLR for the mixed modes sketch.
328+
*/
321329
public void enterWarnMixedModes(ProcessingParser.WarnMixedModesContext ctx) {
322330
pdeParseTreeErrorListenerMaybe.ifPresent((listener) -> {
323331
Token token = ctx.getStart();

0 commit comments

Comments
 (0)