-
-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Description
Description
The Processing 4.5.2 parser rejects desktop.open(file) with a syntax error.
The method name open appears to be treated as a reserved token in the ANTLR grammar,
but it is not a Java reserved keyword.
Minimal reproduction
void setup() { size(200, 200); }
void draw() { background(0); }
void testOpen() {
try {
java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
java.io.File file = new java.io.File(".");
desktop.open(file); // <-- Syntax Error
} catch (Exception e) {
println(e.getMessage());
}
}Error message
DesktopTest.pde:7:1:7:1: Syntax Error - Error on parameter or method declaration near desktop.open(?
Notes
- desktop.browse(file.toURI()) works fine
- Replacing open with any non-reserved name works
- This code worked in Processing 4.2
- Tested with Processing 4.5.2 CLI on Windows 11
Expected behavior
open should be a valid method name since it is not a Java reserved keyword.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels