From 7dd5a0854e404b604682bd4dd7402bb4f12de5b0 Mon Sep 17 00:00:00 2001 From: Greg Tucker Date: Thu, 30 Nov 2023 09:48:53 +0000 Subject: [PATCH] [Add] mccode-antlr version to generated C file header for help sorting-out bugs (#27) --- mccode_antlr/translators/c_header.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mccode_antlr/translators/c_header.py b/mccode_antlr/translators/c_header.py index ebe6cac..6cfce04 100644 --- a/mccode_antlr/translators/c_header.py +++ b/mccode_antlr/translators/c_header.py @@ -1,5 +1,6 @@ def header_pre_runtime(is_mcstas, source, runtime: dict, config: dict, typedefs: list, uservars: list): from datetime import datetime + from mccode_antlr import version def jump_line(instance, jump): return f'long Jump_{instance.name}_{jump}; /* the JUMP connection _ */' @@ -56,6 +57,7 @@ def jump_line(instance, jump): contents = f"""/* Automatically generated file. Do not edit. * Format: ANSI C source code * Creator: {runtime.get("fancy")} <{runtime.get("url")}> + * Generator: mccode-antlr {version()} * Instrument: {source.source} ({source.name}) * Date: {datetime.now()} * File: {config.get('output')}