Commit 243eb4b40d74d659629703ecca66de583c5ee0ec

Tidying up
System/Hardware/SSC32.hs
(9 / 7)
  
1212import Text.Parsec.Language
1313
1414nat = (P.natural $ P.makeTokenParser haskellDef) >>= return.fromIntegral
15ch = char '#' >> nat
16pos = char 'P' >> nat
17spd = char 'S' >> nat
18tme = char 'T' >> nat
19pair a b = (a,b)
15sym x = char x >> nat
16ch = sym '#'
17pos = sym 'P'
18spd = sym 'S'
19tme = sym 'T'
20
2021abrt = string "abort" >> return Abort
21mve' = Move <$> (ch <* spaces)
22mve = abrt <|>
23 Move <$> (ch <* spaces)
2224 <*> (pos <* spaces)
2325 <*> optionMaybe spd
24mve = abrt <|> mve'
26
2527mves = GroupMove <$> many mve <*> optionMaybe tme
2628
2729parseMoves s = case parse mves "" s of