hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit c252b3e466365af7dc7fc6bea94d17a85653f9f2
parent 184ac22373487aab4ff720789137bc8e27d9165b
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 12 Feb 2021 13:42:59 -0500

strconv: style

Diffstat:
Mstrconv/itos.ha | 9++++-----
Mstrconv/utos.ha | 9++++-----
2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/strconv/itos.ha b/strconv/itos.ha @@ -18,17 +18,16 @@ export fn i64tosb(i: i64, b: base) const str = { static let buf: [66]u8 = [0...]; // 64 binary digits plus NUL and - buf = [0...]; - static const lut_upper: [_]rune = [ + static const lut_upper = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', - ]; - static const lut_lower: [_]rune = [ + ], lut_lower = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', ]; - let lut = if (b != base::HEX_LOWER) lut_upper else { + const lut = if (b != base::HEX_LOWER) &lut_upper else { b = base::HEX_UPPER; - lut_lower; + &lut_lower; }; let s = types::string { data = &buf, ... }; diff --git a/strconv/utos.ha b/strconv/utos.ha @@ -9,17 +9,16 @@ export fn u64tosb(u: u64, b: base) const str = { static let buf: [65]u8 = [0...]; // 64 binary digits plus NUL buf = [0...]; - static const lut_upper: [_]rune = [ + static const lut_upper = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', - ]; - static const lut_lower: [_]rune = [ + ], lut_lower = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', ]; - let lut = if (b != base::HEX_LOWER) lut_upper else { + const lut = if (b != base::HEX_LOWER) &lut_upper else { b = base::HEX_UPPER; - lut_lower; + &lut_lower; }; let s = types::string { data = &buf, ... };