aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Verilog/Parser.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-04-03 17:30:51 +0100
committerYann Herklotz <git@ymhg.org>2019-04-03 17:30:51 +0100
commit77559b722fca9c873e29d5735b309c0a8d8f2022 (patch)
treeac1259d60954c95ab6bfe7437053471c8e4114f7 /src/VeriFuzz/Verilog/Parser.hs
parent3eb5b42c118c555aea736b5ca9b685ecdf72bd14 (diff)
downloadverismith-77559b722fca9c873e29d5735b309c0a8d8f2022.tar.gz
verismith-77559b722fca9c873e29d5735b309c0a8d8f2022.zip
Apply brittany to modified modules
Diffstat (limited to 'src/VeriFuzz/Verilog/Parser.hs')
-rw-r--r--src/VeriFuzz/Verilog/Parser.hs14
1 files changed, 8 insertions, 6 deletions
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