mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-22 08:22:04 +03:00
Fixed pre processor bug. Closes #1245
This commit is contained in:
@ -112,13 +112,13 @@ public class PdePreprocessor {
|
||||
// }
|
||||
|
||||
prototypes = prototypes(program);
|
||||
|
||||
|
||||
// store # of prototypes so that line number reporting can be adjusted
|
||||
prototypeCount = prototypes.size();
|
||||
|
||||
// do this after the program gets re-combobulated
|
||||
this.program = program;
|
||||
|
||||
|
||||
return headerCount + prototypeCount;
|
||||
}
|
||||
|
||||
@ -244,7 +244,9 @@ public class PdePreprocessor {
|
||||
// XXX: doesn't properly handle special single-quoted characters
|
||||
// single-quoted character
|
||||
String p = "('.')";
|
||||
|
||||
|
||||
p += "|('\\\\\"')";
|
||||
|
||||
// double-quoted string
|
||||
p += "|(\"(?:[^\"\\\\]|\\\\.)*\")";
|
||||
|
||||
@ -294,7 +296,7 @@ public class PdePreprocessor {
|
||||
|
||||
public ArrayList<String> prototypes(String in) {
|
||||
in = collapseBraces(strip(in));
|
||||
|
||||
|
||||
// XXX: doesn't handle ... varargs
|
||||
// XXX: doesn't handle function pointers
|
||||
Pattern prototypePattern = Pattern.compile("[\\w\\[\\]\\*]+\\s+[&\\[\\]\\*\\w\\s]+\\([&,\\[\\]\\*\\w\\s]*\\)(?=\\s*;)");
|
||||
|
Reference in New Issue
Block a user