Simplified the parser
authorNeil Smith <neil.git@njae.me.uk>
Wed, 20 Dec 2017 21:54:00 +0000 (21:54 +0000)
committerNeil Smith <neil.git@njae.me.uk>
Wed, 20 Dec 2017 21:54:00 +0000 (21:54 +0000)
src/advent20/advent20.hs

index 4d852a604d299fcf9ca7f762867c72dd4074bfc5..4822db9ec324c983cee9017925a74533840d30cf 100644 (file)
@@ -109,12 +109,11 @@ integer       = lexeme L.integer
 signedInteger = L.signed sc integer
 
 symbol = L.symbol sc
-separator = symbol ", "
 comma = symbol ","
 
 particlesP = particleP `sepBy` space
-particleP = particlify <$> (symbol "p=" *> vecP <* separator)
-                       <*> (symbol "v=" *> vecP <* separator)
+particleP = particlify <$> (symbol "p=" *> vecP <* comma)
+                       <*> (symbol "v=" *> vecP <* comma)
                        <*> (symbol "a=" *> vecP)
     where particlify p v a = Particle { position = p
                                       , velocity = v