diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-02-22 12:50:48 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-02-22 12:50:48 (EST) |
commit | e95515664a943d8968c492f242a7d4b0729ea4b5 (patch) | |
tree | 0f2621be0da8f66f344c8ac79824bacc8c315704 /eshtrans/backend | |
parent | c40e6e23966b9fd51ffa700903667cb552a52923 (diff) | |
download | eggshell-e95515664a943d8968c492f242a7d4b0729ea4b5.zip eggshell-e95515664a943d8968c492f242a7d4b0729ea4b5.tar.gz eggshell-e95515664a943d8968c492f242a7d4b0729ea4b5.tar.bz2 |
eshtrans/backend: Generate translation unit ID
Diffstat (limited to 'eshtrans/backend')
-rw-r--r-- | eshtrans/backend/codegen.esh | 10 | ||||
-rw-r--r-- | eshtrans/backend/main.esh | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/eshtrans/backend/codegen.esh b/eshtrans/backend/codegen.esh index 8d77ce9..a9c3cef 100644 --- a/eshtrans/backend/codegen.esh +++ b/eshtrans/backend/codegen.esh @@ -109,3 +109,13 @@ sh_parse_stack() done codegen_sub "${array}" } + +sh_set_tu_id() +{ + local toks="${1}" + + tu_id="$(printf '%s' "${toks}" | sha256sum -)" + tu_id="${tu_id% -}" + + return 0 +} diff --git a/eshtrans/backend/main.esh b/eshtrans/backend/main.esh index 884a2c3..485e9be 100644 --- a/eshtrans/backend/main.esh +++ b/eshtrans/backend/main.esh @@ -23,6 +23,7 @@ sh_codegen() local toks="${1}" shift 1 + sh_set_tu_id "${toks}" if printf '%s' "${toks}" | sh_parse_stack; then return 0 else |