diff options
| author | gingerBill <bill@gingerbill.org> | 2022-11-02 00:05:51 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-11-02 00:05:51 +0000 |
| commit | 3b583cbac752435ec9385201f27438c96b6f8f7b (patch) | |
| tree | 4c6db55b073717dc6f4178325e6052bba4871303 /src/exact_value.cpp | |
| parent | 382bd87667a275f9b276886f7c1e8caac4dda5f6 (diff) | |
Add debug symbols for global constants of integers, bools, enums, runes, & pointers.
Variables are namespaced with `pkg::name` or `name` if built-in or the initial package for convenience.
Diffstat (limited to 'src/exact_value.cpp')
| -rw-r--r-- | src/exact_value.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/exact_value.cpp b/src/exact_value.cpp index 1572b564f..659db33b7 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -499,6 +499,13 @@ i64 exact_value_to_i64(ExactValue v) { } return 0; } +u64 exact_value_to_u64(ExactValue v) { + v = exact_value_to_integer(v); + if (v.kind == ExactValue_Integer) { + return big_int_to_u64(&v.value_integer); + } + return 0; +} f64 exact_value_to_f64(ExactValue v) { v = exact_value_to_float(v); if (v.kind == ExactValue_Float) { |