feat: move awk prep call to Python

Co-Authored-By: Anja Rabich <a.rabich@uni-luebeck.de>
This commit is contained in:
Benjamin Lipp
2025-05-06 17:25:58 +02:00
parent 437c591b2d
commit 73b04cdc12
2 changed files with 14 additions and 9 deletions

View File

@@ -41,6 +41,17 @@ def cpp(file, cpp_prep):
params = ["cpp", "-P", f"-I{cwd}/{dirname}", file, "-o", cpp_prep]
return exc(params, stderr=pkgs.sys.stderr)
@click.command()
@click.argument("cpp_prep")
@click.argument("awk_prep")
def awk_prep(cpp_prep, awk_prep):
params = ["awk", "-f", "marzipan/marzipan.awk", cpp_prep]
with open(awk_prep, 'w') as file:
exc(params, stderr=pkgs.sys.stderr, stdout=file)
file.write("\nprocess main")
@click.command()
@click.argument("prefix")
@click.argument("mark")
@@ -96,5 +107,6 @@ main.add_command(analyze)
main.add_command(clean)
main.add_command(run_proverif)
main.add_command(cpp)
main.add_command(awk_prep)
main.add_command(pretty_output_line)
main.add_command(clean_warnings)

View File

@@ -99,17 +99,10 @@ metaverif() {
local name; name="$(echo "${file}" | grep -Po '[^/]*(?=\.mpv)')"
local cpp_prep; cpp_prep="${tmpdir}/${name}.i.pv"
echo "internal metaverif"
local awk_prep; awk_prep="${tmpdir}/${name}.o.pv"
exc rosenpass-marzipan cpp ${file} ${cpp_prep}
local awk_prep; awk_prep="${tmpdir}/${name}.o.pv"
{
exc awk -f marzipan/marzipan.awk "${cpp_prep}"
echo -e "\nprocess main"
} > "${awk_prep}"
exc rosenpass-marzipan awk-prep ${cpp_prep} ${awk_prep}
local log; log="${tmpdir}/${name}.log"
{