| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4b236aa commit 422fc90
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -307,9 +307,6 @@ preproc.substitute_floats = true | |||
| 307 | 307 | #preproc.substitute_image = false | |
| 308 | 308 | #preproc.substitute_font = false | |
| 309 | 309 | ||
| 310 | - # auto-convert non-ascii chars to unicode escape sequences | ||
| 311 | - preproc.substitute_unicode = true | ||
| 312 | - | ||
| 313 | 310 | # PdePreproc.java | |
| 314 | 311 | # writes out the parse tree as parseTree.xml, which can be usefully | |
| 315 | 312 | # viewed in (at least) Mozilla or IE. useful when debugging the preprocessor. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -907,15 +907,15 @@ public PreprocessorResult write(Writer out, String program, | |||
| 907 | 907 | // these ones have the .* at the end, since a class name might be at the end | |
| 908 | 908 | // instead of .* which would make trouble other classes using this can lop | |
| 909 | 909 | // off the . and anything after it to produce a package name consistently. | |
| 910 | - final ArrayList<String> programImports = new ArrayList<String>(); | ||
| 910 | + final ArrayList<String> programImports = new ArrayList<>(); | ||
| 911 | 911 | ||
| 912 | 912 | // imports just from the code folder, treated differently | |
| 913 | 913 | // than the others, since the imports are auto-generated. | |
| 914 | - final ArrayList<String> codeFolderImports = new ArrayList<String>(); | ||
| 914 | + final ArrayList<String> codeFolderImports = new ArrayList<>(); | ||
| 915 | 915 | ||
| 916 | 916 | // need to reset whether or not this has a main() | |
| 917 | 917 | // foundMain = false; | |
| 918 | - foundMethods = new HashSet<String>(); | ||
| 918 | + foundMethods = new HashSet<>(); | ||
| 919 | 919 | ||
| 920 | 920 | // http://processing.org/bugs/bugzilla/5.html | |
| 921 | 921 | if (!program.endsWith("\n")) { | |
@@ -924,12 +924,6 @@ public PreprocessorResult write(Writer out, String program, | |||
| 924 | 924 | ||
| 925 | 925 | checkForUnterminatedMultilineComment(program); | |
| 926 | 926 | ||
| 927 | - // Removing all the Unicode characters makes detecting and reporting their | ||
| 928 | - // preprocessor errors quite hard. | ||
| 929 | - // if (Preferences.getBoolean("preproc.substitute_unicode")) { | ||
| 930 | - // program = substituteUnicode(program); | ||
| 931 | - // } | ||
| 932 | - | ||
| 933 | 927 | // For 0215, adding } as a legitimate prefix to the import (along with | |
| 934 | 928 | // newline and semicolon) for cases where a tab ends with } and an import | |
| 935 | 929 | // statement starts the next tab. | |
@@ -985,44 +979,6 @@ public PreprocessorResult write(Writer out, String program, | |||
| 985 | 979 | } | |
| 986 | 980 | ||
| 987 | 981 | ||
| 988 | - static String substituteUnicode(String program) { | ||
| 989 | - // check for non-ascii chars (these will be/must be in unicode format) | ||
| 990 | - char p[] = program.toCharArray(); | ||
| 991 | - int unicodeCount = 0; | ||
| 992 | - for (int i = 0; i < p.length; i++) { | ||
| 993 | - if (p[i] > 127) | ||
| 994 | - unicodeCount++; | ||
| 995 | - } | ||
| 996 | - if (unicodeCount == 0) | ||
| 997 | - return program; | ||
| 998 | - // if non-ascii chars are in there, convert to unicode escapes | ||
| 999 | - // add unicodeCount * 5.. replacing each unicode char | ||
| 1000 | - // with six digit uXXXX sequence (xxxx is in hex) | ||
| 1001 | - // (except for nbsp chars which will be a replaced with a space) | ||
| 1002 | - int index = 0; | ||
| 1003 | - char p2[] = new char[p.length + unicodeCount * 5]; | ||
| 1004 | - for (int i = 0; i < p.length; i++) { | ||
| 1005 | - if (p[i] < 128) { | ||
| 1006 | - p2[index++] = p[i]; | ||
| 1007 | - } else if (p[i] == 160) { // unicode for non-breaking space | ||
| 1008 | - p2[index++] = ' '; | ||
| 1009 | - } else { | ||
| 1010 | - int c = p[i]; | ||
| 1011 | - p2[index++] = '\\'; | ||
| 1012 | - p2[index++] = 'u'; | ||
| 1013 | - char str[] = Integer.toHexString(c).toCharArray(); | ||
| 1014 | - // add leading zeros, so that the length is 4 | ||
| 1015 | - //for (int i = 0; i < 4 - str.length; i++) p2[index++] = '0'; | ||
| 1016 | - for (int m = 0; m < 4 - str.length; m++) | ||
| 1017 | - p2[index++] = '0'; | ||
| 1018 | - System.arraycopy(str, 0, p2, index, str.length); | ||
| 1019 | - index += str.length; | ||
| 1020 | - } | ||
| 1021 | - } | ||
| 1022 | - return new String(p2, 0, index); | ||
| 1023 | - } | ||
| 1024 | - | ||
| 1025 | - | ||
| 1026 | 982 | /** | |
| 1027 | 983 | * preprocesses a pde file and writes out a java file | |
| 1028 | 984 | * @return the class name of the exported Java | |
| Back | FazBrowse Home | New Git URL |
0 commit comments