feat: move parsing of RESULT lines to Python

Co-Authored-By: Anja Rabich <a.rabich@uni-luebeck.de>
This commit is contained in:
Benjamin Lipp
2025-06-10 17:45:21 +02:00
parent 2e27753f4a
commit 5232ab3a8e
2 changed files with 14 additions and 6 deletions

View File

@@ -43,6 +43,18 @@ def cpp(file, cpp_prep):
return exc(params, stderr=pkgs.sys.stderr)
@click.command()
def parse_result_line():
for outp in pkgs.sys.stdin:
match = pkgs.re.search(r'^RESULT .* \b(true|false)\b\.$', outp)
if match:
result = match.group(1)
print(result, flush=True)
else:
pass
@click.command()
@click.argument("cpp_prep")
@click.argument("awk_prep")
@@ -153,5 +165,6 @@ main.add_command(clean)
main.add_command(run_proverif)
main.add_command(cpp)
main.add_command(awk_prep)
main.add_command(parse_result_line)
main.add_command(pretty_output)
main.add_command(clean_warnings)

View File

@@ -43,12 +43,7 @@ metaverif() {
run_proverif "${awk_prep}" "$@" \
| clean_warnings \
| tee "${log}" \
| awk '
/^RESULT/ {
gsub(/\./, "", $NF);
print($NF);
fflush(stdout);
}' \
| exc rosenpass-marzipan parse-result-line \
| pretty_output "${cpp_prep}"
} || {
echo "TODO: Commented out some debug output"