[refactor] auto escape library filenames

This commit is contained in:
Yuichi Nishiwaki 2014-04-06 10:29:49 +09:00
parent 2c79e1874c
commit def57348c1
1 changed files with 12 additions and 4 deletions

View File

@ -4,14 +4,22 @@ from collections import OrderedDict
outfn = 'src/load_piclib.c'
libs = [
'piclib/built-in.scm',
'piclib/srfi/1.scm',
'piclib/srfi/26.scm',
'piclib/srfi/95.scm',
]
if os.path.exists(outfn):
os.remove(outfn)
piclibs = OrderedDict()
piclibs['piclib/built-in.scm'] = 'piclib_built_in'
piclibs['piclib/srfi/1.scm'] = 'piclib_srfi_1'
piclibs['piclib/srfi/26.scm'] = 'piclib_srfi_26'
piclibs['piclib/srfi/95.scm'] = 'piclib_srfi_95'
for lib in libs:
vname = lib[:-4]
vname = re.sub(r'/', r'_', vname)
vname = re.sub(r'-', r'_', vname)
piclibs[lib] = vname
def escape_scm(infn, outfn, vname):
with open(outfn, 'a') as output: