[gnoduino] fix function prototype generation



commit c3669204b6d27a13a1d7794d1d6a36c9f9fb2889
Author: Lucian Langa <lucilanga gnome org>
Date:   Thu Jan 3 23:46:16 2013 +0100

    fix function prototype generation

 src/preproc.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/preproc.py b/src/preproc.py
index 82e00fd..dd09549 100644
--- a/src/preproc.py
+++ b/src/preproc.py
@@ -117,9 +117,12 @@ def addHeaders(path, b):
 	fs = firstStatement(cont)
 	if fs != None:
 		proto = genPrototype(cont)
-		incl = lastInclude(cont)
-		result = cont[:fs:]+"\n#include \""+misc.getArduinoAPIFile()+"\"\n" \
-			+ cont[:incl:] + "\n" + proto + cont[fs+incl:]+"\n\n"
+		lastinc = lastInclude(cont)
+		incl = "\n#include \""+misc.getArduinoAPIFile()+"\"\n"
+		print fs
+		result = cont[:fs:] + incl + cont[fs:lastinc:] + "\n" \
+			 + proto + cont[lastinc:] + "\n\n"
+		print result
 	else:
 		result = "\n#include \""+misc.getArduinoAPIFile()+"\"\n"+cont+"\n\n"
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]