From 77559b722fca9c873e29d5735b309c0a8d8f2022 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 3 Apr 2019 17:30:51 +0100 Subject: Apply brittany to modified modules --- src/VeriFuzz/Config.hs | 17 +++++++++++------ src/VeriFuzz/Verilog/Parser.hs | 14 ++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'src/VeriFuzz') diff --git a/src/VeriFuzz/Config.hs b/src/VeriFuzz/Config.hs index eefebe2..b8a1062 100644 --- a/src/VeriFuzz/Config.hs +++ b/src/VeriFuzz/Config.hs @@ -83,15 +83,20 @@ twoKey a b = Toml.Key (a :| [b]) probCodec :: TomlCodec Probability probCodec = Probability - <$> defaultValue (defProb probAssign) (Toml.int $ twoKey "moditem" "assign") + <$> defaultValue (defProb probAssign) + (Toml.int $ twoKey "moditem" "assign") .= _probAssign - <*> defaultValue (defProb probAlways) (Toml.int $ twoKey "moditem" "always") + <*> defaultValue (defProb probAlways) + (Toml.int $ twoKey "moditem" "always") .= _probAlways - <*> defaultValue (defProb probBlock) (Toml.int $ twoKey "statement" "blocking") + <*> defaultValue (defProb probBlock) + (Toml.int $ twoKey "statement" "blocking") .= _probBlock - <*> defaultValue (defProb probNonBlock) (Toml.int $ twoKey "statement" "nonblocking") + <*> defaultValue (defProb probNonBlock) + (Toml.int $ twoKey "statement" "nonblocking") .= _probNonBlock - <*> defaultValue (defProb probNonBlock) (Toml.int $ twoKey "statement" "conditional") + <*> defaultValue (defProb probNonBlock) + (Toml.int $ twoKey "statement" "conditional") .= _probCond where defProb i = defaultConfig ^. configProbability . i @@ -103,7 +108,7 @@ propCodec = <*> Toml.dioptional (Toml.int "seed") .= _propSeed <*> defaultValue (defProp propDepth) (Toml.int "depth") - .= _propDepth + .= _propDepth where defProp i = defaultConfig ^. configProperty . i configCodec :: TomlCodec Config diff --git a/src/VeriFuzz/Verilog/Parser.hs b/src/VeriFuzz/Verilog/Parser.hs index 5e8bb55..a072ce8 100644 --- a/src/VeriFuzz/Verilog/Parser.hs +++ b/src/VeriFuzz/Verilog/Parser.hs @@ -215,8 +215,8 @@ number = number' <$> numLit where number' :: String -> Decimal number' a | all (`elem` ['0' .. '9']) a = fromInteger $ read a - | head a == '\'' = fromInteger $ f a - | "'" `isInfixOf` a = Decimal (read w) (f b) + | head a == '\'' = fromInteger $ f a + | "'" `isInfixOf` a = Decimal (read w) (f b) | otherwise = error $ "Invalid number format: " ++ a where w = takeWhile (/= '\'') a @@ -309,8 +309,10 @@ parseVerilogSrc = Verilog <$> many parseDescription -- | Parse a 'String' containing verilog code. The parser currently only supports -- the subset of Verilog that is being generated randomly. -parseVerilog :: String -- ^ Name of parsed object. - -> String -- ^ Content to be parsed. - -> Either String Verilog -- ^ Returns 'String' with error +parseVerilog + :: String -- ^ Name of parsed object. + -> String -- ^ Content to be parsed. + -> Either String Verilog -- ^ Returns 'String' with error -- message if parse fails. -parseVerilog s = bimap show id . parse parseVerilogSrc s . alexScanTokens . preprocess [] s +parseVerilog s = + bimap show id . parse parseVerilogSrc s . alexScanTokens . preprocess [] s -- cgit