Fix off-by-one error in intToAscii logic
commitb28f5e47b7664464a077db8da1021f5cf3d389f9
authorEvan Czaplicki <evancz@users.noreply.github.com>
dateMon 29 Jan 2018, 22:14 (9 years ago)
parentb6c5ffe
src/Generate/JavaScript/Name.hs+2−2
@@ -292,8 +292,8 @@ toByte :: Int -> Word8
292292toByte n
293293 | n < 26 = fromIntegral (97 + n ) {- lower -}
294294 | n < 52 = fromIntegral (65 + n - 26) {- upper -}
295− | n == 53 = 95 {- _ -}
296− | n == 54 = 36 {- $ -}
295+ | n == 52 = 95 {- _ -}
296+ | n == 53 = 36 {- $ -}
297297 | n < 64 = fromIntegral (48 + n - 54) {- digit -}
298298 | True = error $ "cannot convert int " ++ show n ++ " to ASCII"
299299