mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 14:13:23 +00:00
Move `mk_pat_db_internal()
from
mk_util.py
` to
``mk_genfile_common.py`` and adapt ``mk_util.py`` and ``mk_pat_db.py`` to use the code at its new location. Whilst I'm here reindent ``mk_mem_initializer_cpp.py``. The purpose of this change is to have Python code common to the Python and CMake build systems separate from Python code that is only used for the Python build system.
This commit is contained in:
parent
114e165fad
commit
8840e5a00f
3 changed files with 30 additions and 28 deletions
|
@ -376,3 +376,18 @@ def mk_mem_initializer_cpp_internal(component_src_dirs, path):
|
|||
fout.write('}\n')
|
||||
fout.close()
|
||||
return fullname
|
||||
|
||||
###############################################################################
|
||||
# Functions for generating ``database.h``
|
||||
###############################################################################
|
||||
|
||||
def mk_pat_db_internal(inputFilePath, outputFilePath):
|
||||
"""
|
||||
Generate ``g_pattern_database[]`` declaration header file.
|
||||
"""
|
||||
with open(inputFilePath, 'r') as fin:
|
||||
with open(outputFilePath, 'w') as fout:
|
||||
fout.write('static char const g_pattern_database[] =\n')
|
||||
for line in fin:
|
||||
fout.write('"%s\\n"\n' % line.strip('\n'))
|
||||
fout.write(';\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue