Commit 867362e
committed
Do not insert prototypes in the middle of a line.
The insertion point of prototypes may be detected to be in the middle
of a line for example in the following sketch:
int a; int b=forwardDeclared();
void setup() {}
void loop() {}
int forwardDeclared() { return 0; }
the insertion point is determined to be between `int a;` and `int b=..`
since the latter declaration use a forward-declared function to
initialize variable.
Before this patch this resulted in a stray `#line` directive inserted in
the middle of a line:
int a; #line 1 ...... <- added prototype line
int forwardDeclared(); <- added prototype
#line 2..... <- other prototypes....
......
This patch avoids the situation above by inserting a newline just before
the first `#line` directive if the insertion point happens to be in the
middle of a line.
Fix #71 parent 823ce61 commit 867362e
1 file changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 200 | + | |
204 | 201 | | |
205 | 202 | | |
206 | 203 | | |
| |||
216 | 213 | | |
217 | 214 | | |
218 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
219 | 228 | | |
220 | | - | |
| 229 | + | |
221 | 230 | | |
222 | | - | |
| 231 | + | |
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
| |||
0 commit comments