Skip to content

Commit

Permalink
Move to ANTLR 4 with Java 11 lang features and localization. (#5)
Browse files Browse the repository at this point in the history
* Move to ANTLR 4 with Java 11 lang features and localization.

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).

* Ask travis for ant upgrade prior to run.

* Ask Travis for java11 update.

* Add openjdk ppa

* Travis no confirmation on add ppa.

* Force newer ant on travis.

* Swtich ant download to www-us mirror.

* Switch ant to 1.10.7

* Start x for unit tests in travis.

* More complete start x in travis.

* Revert x in travis.

* Try x in services.
  • Loading branch information
sampottinger committed Oct 6, 2019
1 parent 00dd280 commit ee299ef
Show file tree
Hide file tree
Showing 254 changed files with 9,331 additions and 6,472 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Expand Up @@ -9,8 +9,16 @@ jdk:
before_install:
- sudo apt-get -qq update
- sudo apt-get install ant-optional
- sudo apt-get install wget
- wget --no-check-certificate https://www-us.apache.org/dist//ant/binaries/apache-ant-1.10.7-bin.tar.gz
- tar -xzvf apache-ant-1.10.7-bin.tar.gz
- export PATH=`pwd`/apache-ant-1.10.7/bin:$PATH

services:
- xvfb

before_script:
- export DISPLAY=:99.0
- cd build

script:
Expand Down
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.

0 comments on commit ee299ef

Please sign in to comment.