aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Parser.hs
diff options
context:
space:
mode:
authorMarvin Borner2024-05-02 21:57:58 +0200
committerMarvin Borner2024-05-02 21:57:58 +0200
commita25ed8a75d036de252cfe74b5fa0788215194b41 (patch)
tree65ab549fe20b719535113a4af40bd4c784765cbb /src/Parser.hs
parent349e8574c67bf575ed39694c8085eab00473bfaa (diff)
More math
MAATHTHAHHAHA
Diffstat (limited to 'src/Parser.hs')
-rw-r--r--src/Parser.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Parser.hs b/src/Parser.hs
index a24db6f..0274906 100644
--- a/src/Parser.hs
+++ b/src/Parser.hs
@@ -149,11 +149,11 @@ parseFloat :: Parser Expression
parseFloat = do
_ <- string "(" <?> "float start"
num <- signedFloat <?> "signed float"
- base <- try (oneOf "fr") <|> return 'f'
+ base <- try (oneOf "qr") <|> return 'q'
_ <- string ")" <?> "float end"
pure $ f base num
where
- f 'f' = floatToRational
+ f 'q' = floatToRational
f 'r' = floatToReal
f _ = invalidProgramState
sign :: Parser (Rational -> Rational)
@@ -171,8 +171,8 @@ parseComplex :: Parser Expression
parseComplex = do
_ <- string "(" <?> "complex start"
real <- signedFloat <?> "signed complex"
- _ <- char 'i'
imaginary <- signedFloat <?> "signed complex"
+ _ <- char 'i'
_ <- string ")" <?> "complex end"
pure $ floatToComplex real imaginary
where