bahaghari: reformat codebase

This commit is contained in:
Gabriel Arazas 2024-02-29 16:12:21 +08:00
parent fb634531e4
commit e5083302b2
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 84 additions and 53 deletions

View File

@ -5,8 +5,24 @@
let
glyphList =
[ "0" "1" "2" "3" "4" "5" "6" "7"
"8" "9" "A" "B" "C" "D" "E" "F" ];
[
"0"
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
"A"
"B"
"C"
"D"
"E"
"F"
];
baseSet = lib.generateBaseDigitType glyphList;
in

View File

@ -113,7 +113,6 @@ rec {
base = 2;
glyphSet = { "0" = "0"; "1" = "1"; };
conversionTable = { "0" = 0; "1" = 1; };
isValidDigit = <function>;
fromDec = <function>;
toDec = <function>;
}
@ -169,7 +168,7 @@ rec {
iter = product: counter: max-count:
if counter > max-count
then product
else (iter (product * base) (counter + 1) max-count);
else iter (product * base) (counter + 1) max-count;
in
iter 1 1 exponent;
}

View File

@ -95,8 +95,24 @@ pkgs.lib.runTests {
testGenerateConversionTable2 = {
expr = lib.trivial.generateConversionTable
[ "0" "1" "2" "3" "4" "5" "6" "7"
"8" "9" "A" "B" "C" "D" "E" "F" ];
[
"0"
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
"A"
"B"
"C"
"D"
"E"
"F"
];
expected = {
"0" = 0;
"1" = 1;