diff --git a/src/Kind/Parse.hs b/src/Kind/Parse.hs index 8c65db7c3..fc33064de 100644 --- a/src/Kind/Parse.hs +++ b/src/Kind/Parse.hs @@ -412,7 +412,6 @@ parseUse = parseLocal "use" Use parseSet = withSrc $ char_end '*' >> return Set - parseFloat = withSrc $ P.try $ do -- Parse optional negative sign sign <- P.option id $ P.char '-' >> return negate @@ -439,7 +438,11 @@ parseFloat = withSrc $ P.try $ do -- Apply the sign to the final value return $ Flt (sign value) -parseNum = withSrc $ Num . read <$> P.many1 digit +parseNum = withSrc $ P.choice + [ P.try (string_skp "0x") >> (Num . read . ("0x" ++) <$> P.many1 P.hexDigit) + , P.try (string_skp "0b") >> (Num . read . ("0b" ++) <$> P.many1 (oneOf "01")) + , Num . read <$> P.many1 digit + ] parseOp2 = withSrc $ do opr <- P.try $ do diff --git a/src/Kind/Type.hs b/src/Kind/Type.hs index 4a684ffe9..ca58267d0 100644 --- a/src/Kind/Type.hs +++ b/src/Kind/Type.hs @@ -136,28 +136,3 @@ data Env a = Env (State -> Res a) -- monadic checker -- UNCOMMENT THIS TO DEBUG THE TYPE CHECKER -- debug a b = trace a b debug a b = b - --- -- Global Memory --- memory :: IORef (IM.IntMap Word64) --- memory = unsafePerformIO $ newIORef IM.IntMap.empty --- [># NOINLINE memory #<] - --- -- Function to mutate the global IntMap --- swap :: Word64 -> Word64 -> Word64 --- swap key val = unsafePerformIO $ do - -- mem <- readIORef memory - -- let newMem = IntMap.insert (fromIntegral key) val mem - -- writeIORef memory mem - - - - - - - - - - - - -