diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-08 12:37:07 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-08 12:37:07 +0100 |
| commit | 13deb4706c37acbababc6f60a1b6ec58c630a3f5 (patch) | |
| tree | 764e98b0b49f111fd8a33ae5cc3a80070e1a0231 /src/exact_value.cpp | |
| parent | 9b61adb97dd78e1cf04ad410e72166f684f97925 (diff) | |
Update `String` to use overloading
Diffstat (limited to 'src/exact_value.cpp')
| -rw-r--r-- | src/exact_value.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/exact_value.cpp b/src/exact_value.cpp index d8d015d47..2bdf3fdf5 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -36,6 +36,8 @@ typedef struct ExactValue { }; } ExactValue; +gb_global ExactValue const empty_exact_value = {}; + HashKey hash_exact_value(ExactValue v) { return hashing_proc(&v, gb_size_of(ExactValue)); } @@ -191,7 +193,7 @@ ExactValue exact_value_from_basic_literal(Token token) { case Token_Float: return exact_value_float_from_string(token.string); case Token_Imag: { String str = token.string; - Rune last_rune = cast(Rune)str.text[str.len-1]; + Rune last_rune = cast(Rune)str[str.len-1]; str.len--; // Ignore the `i|j|k` f64 imag = float_from_string(str); |