Skip to content

Commit ee299ef

Browse files
authored
Move to ANTLR 4 with Java 11 lang features and localization. (#5)
* 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.
1 parent 00dd280 commit ee299ef

File tree

254 files changed

+9331
-6472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+9331
-6472
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ jdk:
99
before_install:
1010
- sudo apt-get -qq update
1111
- sudo apt-get install ant-optional
12+
- sudo apt-get install wget
13+
- wget --no-check-certificate https://www-us.apache.org/dist//ant/binaries/apache-ant-1.10.7-bin.tar.gz
14+
- tar -xzvf apache-ant-1.10.7-bin.tar.gz
15+
- export PATH=`pwd`/apache-ant-1.10.7/bin:$PATH
16+
17+
services:
18+
- xvfb
1219

1320
before_script:
21+
- export DISPLAY=:99.0
1422
- cd build
1523

1624
script:

app/src/processing/app/Platform.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ public class Platform {
7575

7676
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7777

78+
static public boolean isInit() {
79+
return inst != null;
80+
}
81+
7882

7983
static public void init() {
8084
try {

app/src/processing/app/tools/InstallCommander.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,4 @@ public boolean accept(File dir, String name) {
161161
list.append(jar.getAbsolutePath());
162162
}
163163
}
164-
}
164+
}

app/src/processing/app/ui/Editor.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,7 +2898,6 @@ public void statusError(String what) {
28982898
* Show an exception in the editor status bar.
28992899
*/
29002900
public void statusError(Exception e) {
2901-
e.printStackTrace();
29022901
// if (e == null) {
29032902
// System.err.println("Editor.statusError() was passed a null exception.");
29042903
// return;
@@ -2909,9 +2908,7 @@ public void statusError(Exception e) {
29092908

29102909
// Make sure something is printed into the console
29112910
// Status bar is volatile
2912-
if (!re.isStackTraceEnabled()) {
2913-
System.err.println(re.getMessage());
2914-
}
2911+
System.err.println(re.getMessage());
29152912

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

29452944
// Since this will catch all Exception types, spend some time figuring

app/test/resources/annotations.expected

Lines changed: 0 additions & 53 deletions
This file was deleted.

app/test/resources/bug1064.expected

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/test/resources/bug136.expected

Lines changed: 0 additions & 41 deletions
This file was deleted.

app/test/resources/bug1362.expected

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/test/resources/bug1442.expected

Lines changed: 0 additions & 28 deletions
This file was deleted.

app/test/resources/bug1511.expected

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)