diff --git a/ino/commands/preproc.py b/ino/commands/preproc.py index 73ff1e1..8ec52da 100644 --- a/ino/commands/preproc.py +++ b/ino/commands/preproc.py @@ -58,6 +58,8 @@ def prototypes(self, src): def extract_includes(self, src_lines): regex = re.compile("^\\s*#include\\s*[<\"](\\S+)[\">]") + preproc_re = re.compile("^\\s*#") + includes = [] sketch = [] for line in src_lines: @@ -70,6 +72,9 @@ def extract_includes(self, src_lines): # 2) line numbers will be preserved sketch.append('//' + line) else: + m = preproc_re.match(line) + if m: + includes.append(line) sketch.append(line) return includes, sketch