From: Neil Smith Date: Wed, 20 Dec 2017 21:54:00 +0000 (+0000) Subject: Simplified the parser X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=1362ef699897009fbcfce9ce43a606c18224fdfd;p=advent-of-code-17.git Simplified the parser --- diff --git a/src/advent20/advent20.hs b/src/advent20/advent20.hs index 4d852a6..4822db9 100644 --- a/src/advent20/advent20.hs +++ b/src/advent20/advent20.hs @@ -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