Make sure parseXXX functions can be mapped correctly

This commit is contained in:
Jakub Valtar
2016-05-06 23:46:01 +02:00
parent 6aedf09854
commit d54b363ea0
2 changed files with 6 additions and 3 deletions

View File

@@ -323,6 +323,8 @@ public class PDEX {
.map(ps::mapJavaToSketch)
// remove occurrences which fall into generated header
.filter(ps::inRange)
// remove empty intervals (happens when occurence was inserted)
.filter(in -> in.startPdeOffset < in.stopPdeOffset)
.collect(Collectors.toList());
int usageCount = intervals.size();

View File

@@ -68,9 +68,10 @@ public class SourceUtils {
String match = matcher.group(1);
int offset = matcher.start(1);
int length = match.length();
String replace = "PApplet.parse"
+ Character.toUpperCase(match.charAt(0));
result.add(Edit.replace(offset, length - (match.length() - 1), replace));
result.add(Edit.insert(offset, "PApplet."));
String replace = "parse"
+ Character.toUpperCase(match.charAt(0)) + match.substring(1);
result.add(Edit.replace(offset, length, replace));
}
return result;