| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -494,7 +494,7 @@ protected boolean checkCode() { | |||
| 494 | 494 | if (problems.length == 0 && !editor.hasJavaTabs()) { | |
| 495 | 495 | //mainClassOffset++; // just a hack. | |
| 496 | 496 | ||
| 497 | - sourceCode = xqpreproc.doYourThing(sourceCode, programImports); | ||
| 497 | + sourceCode = xqpreproc.handle(sourceCode, programImports); | ||
| 498 | 498 | prepareCompilerClasspath(); | |
| 499 | 499 | // mainClassOffset = xqpreproc.mainClassOffset; // tiny, but | |
| 500 | 500 | // // significant | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,6 @@ | |||
| 39 | 39 | import java.awt.event.WindowAdapter; | |
| 40 | 40 | import java.awt.event.WindowEvent; | |
| 41 | 41 | import java.awt.image.BufferedImage; | |
| 42 | - import java.util.ArrayList; | ||
| 43 | 42 | import java.util.List; | |
| 44 | 43 | ||
| 45 | 44 | import javax.swing.text.BadLocationException; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,6 @@ | |||
| 31 | 31 | import org.eclipse.jdt.core.dom.MethodDeclaration; | |
| 32 | 32 | import org.eclipse.jdt.core.dom.Modifier; | |
| 33 | 33 | import org.eclipse.jdt.core.dom.NumberLiteral; | |
| 34 | - import org.eclipse.jdt.core.dom.SimpleType; | ||
| 35 | 34 | import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; | |
| 36 | 35 | import org.eclipse.jface.text.BadLocationException; | |
| 37 | 36 | import org.eclipse.jface.text.Document; | |
@@ -44,9 +43,8 @@ | |||
| 44 | 43 | ||
| 45 | 44 | ||
| 46 | 45 | /** | |
| 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. | ||
| 50 | 48 | */ | |
| 51 | 49 | public class XQPreprocessor { | |
| 52 | 50 | private ASTRewrite rewrite = null; | |
@@ -56,8 +54,10 @@ public class XQPreprocessor { | |||
| 56 | 54 | private String[] defaultImports; | |
| 57 | 55 | ||
| 58 | 56 | ||
| 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 | ||
| 61 | 61 | PdePreprocessor p = new PdePreprocessor(null); | |
| 62 | 62 | defaultImports = p.getDefaultImports(); | |
| 63 | 63 | coreImports = p.getCoreImports(); | |
@@ -67,8 +67,8 @@ public XQPreprocessor(ErrorCheckerService errorCheckerService) { | |||
| 67 | 67 | /** | |
| 68 | 68 | * The main preprocessing method that converts code into compilable Java. | |
| 69 | 69 | */ | |
| 70 | - public String doYourThing(String source, | ||
| 71 | - List<ImportStatement> programImports) { | ||
| 70 | + protected String handle(String source, | ||
| 71 | + List<ImportStatement> programImports) { | ||
| 72 | 72 | this.extraImports = programImports; | |
| 73 | 73 | Document doc = new Document(source); | |
| 74 | 74 | ||
@@ -77,15 +77,15 @@ public String doYourThing(String source, | |||
| 77 | 77 | parser.setKind(ASTParser.K_COMPILATION_UNIT); | |
| 78 | 78 | ||
| 79 | 79 | @SuppressWarnings("unchecked") | |
| 80 | - Map<String, String> options = JavaCore.getOptions(); | ||
| 80 | + Map<String, String> options = JavaCore.getOptions(); | ||
| 81 | 81 | ||
| 82 | 82 | JavaCore.setComplianceOptions(JavaCore.VERSION_1_8, options); | |
| 83 | 83 | options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); | |
| 84 | 84 | parser.setCompilerOptions(options); | |
| 85 | 85 | CompilationUnit cu = (CompilationUnit) parser.createAST(null); | |
| 86 | 86 | cu.recordModifications(); | |
| 87 | 87 | rewrite = ASTRewrite.create(cu.getAST()); | |
| 88 | - cu.accept(new XQASTVisitor()); | ||
| 88 | + cu.accept(new XQVisitor()); | ||
| 89 | 89 | ||
| 90 | 90 | TextEdit edits = cu.rewrite(doc, null); | |
| 91 | 91 | try { | |
@@ -99,7 +99,7 @@ public String doYourThing(String source, | |||
| 99 | 99 | } | |
| 100 | 100 | ||
| 101 | 101 | ||
| 102 | - String prepareImports(List<ImportStatement> programImports) { | ||
| 102 | + protected String prepareImports(List<ImportStatement> programImports) { | ||
| 103 | 103 | this.extraImports = programImports; | |
| 104 | 104 | ||
| 105 | 105 | StringList imports = new StringList(); | |
@@ -139,11 +139,8 @@ String prepareImports(List<ImportStatement> programImports) { | |||
| 139 | 139 | * <LI>Converts doubles into floats, i.e. 12.3 becomes 12.3f so that people | |
| 140 | 140 | * don't have to add f after their numbers all the time since it's confusing | |
| 141 | 141 | * for beginners. Also, most functions of p5 core deal with floats only. | |
| 142 | - * | ||
| 143 | - * @author Manindra Moharana | ||
| 144 | - * | ||
| 145 | 142 | */ | |
| 146 | - private class XQASTVisitor extends ASTVisitor { | ||
| 143 | + private class XQVisitor extends ASTVisitor { | ||
| 147 | 144 | @SuppressWarnings({ "unchecked", "rawtypes" }) | |
| 148 | 145 | public boolean visit(MethodDeclaration node) { | |
| 149 | 146 | if (node.getReturnType2() != null) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -101,7 +101,7 @@ X https://github.com/processing/processing/issues/3608 | |||
| 101 | 101 | X "update all" button appears to do nothing in library manager | |
| 102 | 102 | X https://github.com/processing/processing/issues/3837 | |
| 103 | 103 | 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 | ||
| 105 | 105 | _ https://github.com/processing/processing/issues/3826 | |
| 106 | 106 | ||
| 107 | 107 | jakub | |
@@ -114,6 +114,10 @@ X https://github.com/processing/processing/pull/3845 | |||
| 114 | 114 | X Red error underline is sometimes at wrong location | |
| 115 | 115 | X https://github.com/processing/processing/issues/3759 | |
| 116 | 116 | 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 | ||
| 117 | 121 | ||
| 118 | 122 | ||
| 119 | 123 | known issues | |
@@ -554,11 +558,6 @@ _ http://i.msdn.microsoft.com/Aa511273.Confirmations03(en-us,MSDN.10).png | |||
| 554 | 558 | ||
| 555 | 559 | PDE / Compiler & Preprocessor | |
| 556 | 560 | ||
| 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 | - | ||
| 562 | 561 | medium (bugs/features) | |
| 563 | 562 | _ preprocessor throws error when calling color() on a PGraphics | |
| 564 | 563 | _ https://github.com/processing/processing/issues/3762 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments