Skip to content

Commit

Permalink
[Add] mccode-antlr version to generated C file header for help sortin…
Browse files Browse the repository at this point in the history
…g-out bugs (#27)
  • Loading branch information
g5t authored Nov 30, 2023
1 parent 57bcc1b commit 7dd5a08
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mccode_antlr/translators/c_header.py
Original file line number Diff line number Diff line change
@@ -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 <from>_<to> */'
Expand Down Expand Up @@ -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()} <https://github.com/McStasMcXtrace/mccode-antlr.git>
* Instrument: {source.source} ({source.name})
* Date: {datetime.now()}
* File: {config.get('output')}
Expand Down

0 comments on commit 7dd5a08

Please sign in to comment.