FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

cleaning and todo notes · pkdevbox/processing@01ec407 · GitHub

Repository navigation

Commit 01ec407

Browse files
committed
cleaning and todo notes
1 parent 782dab4 commit 01ec407

4 files changed

Lines changed: 18 additions & 23 deletions

File tree

‎java/src/processing/mode/java/pdex/ErrorCheckerService.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ protected boolean checkCode() {
494494
if (problems.length == 0 && !editor.hasJavaTabs()) {
495495
//mainClassOffset++; // just a hack.
496496

497-
sourceCode = xqpreproc.doYourThing(sourceCode, programImports);
497+
sourceCode = xqpreproc.handle(sourceCode, programImports);
498498
prepareCompilerClasspath();
499499
// mainClassOffset = xqpreproc.mainClassOffset; // tiny, but
500500
// // significant

‎java/src/processing/mode/java/pdex/JavaTextAreaPainter.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import java.awt.event.WindowAdapter;
4040
import java.awt.event.WindowEvent;
4141
import java.awt.image.BufferedImage;
42-
import java.util.ArrayList;
4342
import java.util.List;
4443

4544
import javax.swing.text.BadLocationException;

‎java/src/processing/mode/java/pdex/XQPreprocessor.java‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.eclipse.jdt.core.dom.MethodDeclaration;
3232
import org.eclipse.jdt.core.dom.Modifier;
3333
import org.eclipse.jdt.core.dom.NumberLiteral;
34-
import org.eclipse.jdt.core.dom.SimpleType;
3534
import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
3635
import org.eclipse.jface.text.BadLocationException;
3736
import org.eclipse.jface.text.Document;
@@ -44,9 +43,8 @@
4443

4544

4645
/**
47-
* Implementation of P5 preprocessor that uses Eclipse JDT features instead
48-
* of ANTLR. Performance gains mostly and full control over debug output,
49-
* but needs lots and lots of testing.
46+
* Implementation of PdePreprocessor that uses Eclipse JDT features
47+
* instead of ANTLR.
5048
*/
5149
public class XQPreprocessor {
5250
private ASTRewrite rewrite = null;
@@ -56,8 +54,10 @@ public class XQPreprocessor {
5654
private String[] defaultImports;
5755

5856

59-
public XQPreprocessor(ErrorCheckerService errorCheckerService) {
60-
ecs = errorCheckerService;
57+
public XQPreprocessor(ErrorCheckerService ecs) {
58+
this.ecs = ecs;
59+
60+
// get parameters from the main preproc
6161
PdePreprocessor p = new PdePreprocessor(null);
6262
defaultImports = p.getDefaultImports();
6363
coreImports = p.getCoreImports();
@@ -67,8 +67,8 @@ public XQPreprocessor(ErrorCheckerService errorCheckerService) {
6767
/**
6868
* The main preprocessing method that converts code into compilable Java.
6969
*/
70-
public String doYourThing(String source,
71-
List<ImportStatement> programImports) {
70+
protected String handle(String source,
71+
List<ImportStatement> programImports) {
7272
this.extraImports = programImports;
7373
Document doc = new Document(source);
7474

@@ -77,15 +77,15 @@ public String doYourThing(String source,
7777
parser.setKind(ASTParser.K_COMPILATION_UNIT);
7878

7979
@SuppressWarnings("unchecked")
80-
Map<String, String> options = JavaCore.getOptions();
80+
Map<String, String> options = JavaCore.getOptions();
8181

8282
JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options);
8383
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
8484
parser.setCompilerOptions(options);
8585
CompilationUnit cu = (CompilationUnit) parser.createAST(null);
8686
cu.recordModifications();
8787
rewrite = ASTRewrite.create(cu.getAST());
88-
cu.accept(new XQASTVisitor());
88+
cu.accept(new XQVisitor());
8989

9090
TextEdit edits = cu.rewrite(doc, null);
9191
try {
@@ -99,7 +99,7 @@ public String doYourThing(String source,
9999
}
100100

101101

102-
String prepareImports(List<ImportStatement> programImports) {
102+
protected String prepareImports(List<ImportStatement> programImports) {
103103
this.extraImports = programImports;
104104

105105
StringList imports = new StringList();
@@ -139,11 +139,8 @@ String prepareImports(List<ImportStatement> programImports) {
139139
* <LI>Converts doubles into floats, i.e. 12.3 becomes 12.3f so that people
140140
* don't have to add f after their numbers all the time since it's confusing
141141
* for beginners. Also, most functions of p5 core deal with floats only.
142-
*
143-
* @author Manindra Moharana
144-
*
145142
*/
146-
private class XQASTVisitor extends ASTVisitor {
143+
private class XQVisitor extends ASTVisitor {
147144
@SuppressWarnings({ "unchecked", "rawtypes" })
148145
public boolean visit(MethodDeclaration node) {
149146
if (node.getReturnType2() != null) {

‎todo.txt‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ X https://github.com/processing/processing/issues/3608
101101
X "update all" button appears to do nothing in library manager
102102
X https://github.com/processing/processing/issues/3837
103103
X https://github.com/processing/processing/pull/3842
104-
_ All contributions listed after install button is clicked
104+
_ contributions filter is ignored after clicking Install
105105
_ https://github.com/processing/processing/issues/3826
106106

107107
jakub
@@ -114,6 +114,10 @@ X https://github.com/processing/processing/pull/3845
114114
X Red error underline is sometimes at wrong location
115115
X https://github.com/processing/processing/issues/3759
116116
X https://github.com/processing/processing/pull/3848
117+
X using "new color()" instead of "color()" results in "color type detected"
118+
X happens when user does 'new color' instead of 'color'
119+
X https://github.com/processing/processing/issues/3739
120+
X https://github.com/processing/processing/pull/3850
117121

118122

119123
known issues
@@ -554,11 +558,6 @@ _ http://i.msdn.microsoft.com/Aa511273.Confirmations03(en-us,MSDN.10).png
554558

555559
PDE / Compiler & Preprocessor
556560

557-
live error checker
558-
_ using "new color()" instead of "color()" results in "color type detected"
559-
_ happens when user does 'new color' instead of 'color'
560-
_ https://github.com/processing/processing/issues/3739
561-
562561
medium (bugs/features)
563562
_ preprocessor throws error when calling color() on a PGraphics
564563
_ https://github.com/processing/processing/issues/3762

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL