Changeset: 836177e8d5ff for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/836177e8d5ff
Modified Files:
        misc/python/create_include_object.py.in
Branch: Oct2020
Log Message:

Help on bug #7153 ie don't remove trailing spaces on sql functions so system 
Python UDFs can be parsed later


diffs (36 lines):

diff --git a/misc/python/create_include_object.py.in 
b/misc/python/create_include_object.py.in
--- a/misc/python/create_include_object.py.in
+++ b/misc/python/create_include_object.py.in
@@ -81,15 +81,13 @@ def mal2c(content):
 def sql2c(content):
     comment_or_empty = re.compile('^[ \t]*(--|#|$)')
     comment = re.compile(r'/\*.*?\*/|--.*')
-    space = re.compile('[ \t]+')
     c_array = []
     length = 0
     for line in content.split('\n'):
         if comment_or_empty.match(line):
             continue
         line = comment.sub('', line)
-        line = space.sub(' ', line)
-        line = line.strip()
+        line = line.rstrip()
         if line.startswith('include '):
             continue
         if not line:
@@ -112,7 +110,6 @@ def create_c_sourcefile(srcfile, lang, m
 def copy2c(content):
     return ",".join(str(ord(c)) for c in content) + ","
 
-    
 def txt2c(content, sql):
     buffer = bytearray()
 
@@ -183,7 +180,6 @@ def txt2c(content, sql):
     #return buffer
     return buffer_as_string
 
-    
 def main():
     parser = argparse.ArgumentParser()
     parser.add_argument("name", help="The name of the module to convert")
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to