From 48a171e6c9938dc6444cfbea73acdd6df6d12663 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Wed, 6 Jan 2016 17:58:35 -0500 Subject: [PATCH] Replace Label synonym with String in some parsers The Label type synonym (which is used to identify labels in assembly), is used as a plane String in cInstrDest, cInstrJump and cInstrAluOps parsers. This doesn't cause any compilation or run-time problems because Label is just a type synonym for String, but is ugly and breaks the intended meaning of the Label type. Signed-off-by: Collin J. Doering --- src/lib/RekahSoft/HackAsm/Parser.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/RekahSoft/HackAsm/Parser.hs b/src/lib/RekahSoft/HackAsm/Parser.hs index 4e5ab77..1c1052d 100644 --- a/src/lib/RekahSoft/HackAsm/Parser.hs +++ b/src/lib/RekahSoft/HackAsm/Parser.hs @@ -79,7 +79,7 @@ aInstr = do aInstrAddr <|> aInstrSym -- | TODO: Documentation -cInstrDest :: GenParser Char st (Label, String) +cInstrDest :: GenParser Char st (String, String) cInstrDest = choice [ char 'D' >> return ("D", "010") , char 'M' >> @@ -93,7 +93,7 @@ cInstrDest = , return ("A", "100") ]] -- | TODO: Documentation -cInstrJump :: GenParser Char st (Label, String) +cInstrJump :: GenParser Char st (String, String) cInstrJump = char 'J' >> choice [ string "MP" >> return ("JMP", "111") , string "NE" >> return ("JNE", "101") @@ -107,7 +107,7 @@ cInstrJump = char 'J' >> ] -- | TODO: Documentation -cInstrAluOps :: GenParser Char st (Label, String) +cInstrAluOps :: GenParser Char st (String, String) cInstrAluOps = choice [ char '0' >> return ("0", "0101010") , char '1' >> return ("1", "0111111")