convert numbers to python format
[sv2nmigen.git] / pypreproc.py
index 4569506f5aa3f6c6f0dff719d5df70e0608dc177..164f4304832f4d1da12fa370563d054c144e5f7c 100644 (file)
@@ -1,10 +1,13 @@
-quote = "\""
 import sys
+quote = "\""
+
+
 class Preprocessor:
     def __init__(self):
         self.docstrings = []
-    def removeComments(self,data):
-        #print(data)
+
+    def removeComments(self, data):
+        # print(data)
         ret = ""
         in_docstring = False
         docstring = ""
@@ -14,17 +17,18 @@ class Preprocessor:
                 ret += "//DOCSTRING_PLACEHOLDER\n"
                 in_docstring = True
                 docstring = ""
-            if(in_docstring==False):
+            if(in_docstring == False):
                 ret += line + "\n"
             else:
-                if(not docstring_end):  docstring += line + "\n"
-            if(docstring_end): 
+                if(not docstring_end):
+                    docstring += line + "\n"
+            if(docstring_end):
                 in_docstring = False
                 self.docstrings += [docstring]
-                print(docstring)
         return ret
-    def insertDocstrings(self,data):
-        ret =""
+
+    def insertDocstrings(self, data):
+        ret = ""
         docstring_counter = 0
         for line in data.split("\n"):
             if("//DOCSTRING_PLACEHOLDER" in line):
@@ -36,4 +40,3 @@ class Preprocessor:
             else:
                 ret += "#"+line + "\n"
         return ret
-