aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/CodeGen.hs
diff options
context:
space:
mode:
authorYann Herklotz Grave <git@yannherklotzgrave.com>2019-02-16 22:22:51 +0000
committerYann Herklotz Grave <git@yannherklotzgrave.com>2019-02-16 22:22:51 +0000
commit5f76e8bd89b231ad099448d37f3f04be41fc78da (patch)
tree9fea07fec145d8e02315a3821ebd60a3614e2ef4 /src/VeriFuzz/CodeGen.hs
parentf9159b9e1dfaf9a0b449b632913c8efa1b6674ad (diff)
downloadverismith-5f76e8bd89b231ad099448d37f3f04be41fc78da.tar.gz
verismith-5f76e8bd89b231ad099448d37f3f04be41fc78da.zip
Fix CodeGen bug and add more property tests
Diffstat (limited to 'src/VeriFuzz/CodeGen.hs')
-rw-r--r--src/VeriFuzz/CodeGen.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/VeriFuzz/CodeGen.hs b/src/VeriFuzz/CodeGen.hs
index 3e36cf5..99b52f6 100644
--- a/src/VeriFuzz/CodeGen.hs
+++ b/src/VeriFuzz/CodeGen.hs
@@ -118,7 +118,7 @@ genFunc UnSignedFunc = "$unsigned"
genExpr :: Expr -> Text
genExpr (BinOp eRhs bin eLhs) = "(" <> genExpr eRhs <> genBinaryOperator bin <> genExpr eLhs <> ")"
genExpr (Number s n ) = "(" <> minus <> showT s <> "'h" <> T.pack (showHex (abs n) "") <> ")"
- where minus | signum n > 0 = "" | otherwise = "-"
+ where minus | signum n >= 0 = "" | otherwise = "-"
genExpr (Id i ) = i ^. getIdentifier
genExpr (Concat c ) = "{" <> comma (genExpr <$> c) <> "}"
genExpr (UnOp u e ) = "(" <> genUnaryOperator u <> genExpr e <> ")"