1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-22 08:22:04 +03:00

Don't require a space between #include and < or ".

The space isn't required by the compiler, but the preprocessor needed
one in order to use the #include to figure out which libraries the
sketch used.  That caused an error if you didn't have the space,
because the corresponding library wasn't linked.

http://code.google.com/p/arduino/issues/detail?id=975
This commit is contained in:
David A. Mellis
2012-07-14 21:42:59 -04:00
parent d903d81d60
commit e945d091c5

View File

@ -110,7 +110,7 @@ public class PdePreprocessor {
} }
//String importRegexp = "(?:^|\\s|;)(import\\s+)(\\S+)(\\s*;)"; //String importRegexp = "(?:^|\\s|;)(import\\s+)(\\S+)(\\s*;)";
String importRegexp = "^\\s*#include\\s+[<\"](\\S+)[\">]"; String importRegexp = "^\\s*#include\\s*[<\"](\\S+)[\">]";
programImports = new ArrayList<String>(); programImports = new ArrayList<String>();
String[][] pieces = PApplet.matchAll(program, importRegexp); String[][] pieces = PApplet.matchAll(program, importRegexp);