Skip to content

Commit

Permalink
Move to ANTLR 4 with Java 11 lang features and localization.
Browse files Browse the repository at this point in the history
Introduces ANTLR4 and Java 8 language feature support within IDE while also adding additional hooks for localization of syntax error messages, addressing processing/processing#3054 and processing/processing#3055.

The PR is broadly a continuation of processing/processing#3055, bringing it up to speed with the latest Processing master plus the changes introduced at processing/processing#5753. **Requires processing/processing#5753 as pre-requisite.** This introduces a number of edits beyond processing/processing#3055 beyond compatibility with current Processing master and processing/processing#5753 including:

 - Update to the grammar itself
 - Change ANTLR listeners to emit `TextTransform.Edit` to unify JDT-based `PreprocessingService` and `JavaBuild`, removing code with duplicate purpose.
 - Introduction of syntax error rewriting with support for localization.
 - Addition of complete localized strings set for English and Spanish.
 - Addition of partial localized strings set for other languages.
 - Refactor of ANTLR-related code for testability and readability
 - Expansion of tests including full parse tests for new Java features (type inference, lambdas).
  • Loading branch information
sampottinger committed Oct 6, 2019
1 parent 00dd280 commit cbfa4b3
Show file tree
Hide file tree
Showing 253 changed files with 9,323 additions and 6,472 deletions.
4 changes: 4 additions & 0 deletions app/src/processing/app/Platform.java
Expand Up @@ -75,6 +75,10 @@ public class Platform {

// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

static public boolean isInit() {
return inst != null;
}


static public void init() {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/src/processing/app/tools/InstallCommander.java
Expand Up @@ -161,4 +161,4 @@ public boolean accept(File dir, String name) {
list.append(jar.getAbsolutePath());
}
}
}
}
7 changes: 3 additions & 4 deletions app/src/processing/app/ui/Editor.java
Expand Up @@ -2898,7 +2898,6 @@ public void statusError(String what) {
* Show an exception in the editor status bar.
*/
public void statusError(Exception e) {
e.printStackTrace();
// if (e == null) {
// System.err.println("Editor.statusError() was passed a null exception.");
// return;
Expand All @@ -2909,9 +2908,7 @@ public void statusError(Exception e) {

// Make sure something is printed into the console
// Status bar is volatile
if (!re.isStackTraceEnabled()) {
System.err.println(re.getMessage());
}
System.err.println(re.getMessage());

// Move the cursor to the line before updating the status bar, otherwise
// status message might get hidden by a potential message caused by moving
Expand Down Expand Up @@ -2940,6 +2937,8 @@ public void statusError(Exception e) {
textarea.getLineStopOffset(line) - 1);
}
}
} else {
e.printStackTrace();
}

// Since this will catch all Exception types, spend some time figuring
Expand Down
53 changes: 0 additions & 53 deletions app/test/resources/annotations.expected

This file was deleted.

29 changes: 0 additions & 29 deletions app/test/resources/bug1064.expected

This file was deleted.

41 changes: 0 additions & 41 deletions app/test/resources/bug136.expected

This file was deleted.

29 changes: 0 additions & 29 deletions app/test/resources/bug1362.expected

This file was deleted.

28 changes: 0 additions & 28 deletions app/test/resources/bug1442.expected

This file was deleted.

37 changes: 0 additions & 37 deletions app/test/resources/bug1511.expected

This file was deleted.

29 changes: 0 additions & 29 deletions app/test/resources/bug1512.expected

This file was deleted.

45 changes: 0 additions & 45 deletions app/test/resources/bug1518a.expected

This file was deleted.

43 changes: 0 additions & 43 deletions app/test/resources/bug1518b.expected

This file was deleted.

9 changes: 0 additions & 9 deletions app/test/resources/bug1519.pde

This file was deleted.

0 comments on commit cbfa4b3

Please sign in to comment.