runAsParser :: Eq tok => RunAsParser tok a ErrorString
runAsParser parser s = case runParser parser s of
  Just (a, [])    -> Right a
  Just (_, (_:_)) -> Left . errorString $ "Not the end of token stream."
  Nothing         -> Left . errorString $ "parse error"
runAsParser :: Eq tok => RunAsParser tok a ErrorString
runAsParser parser s = case runParser parser s of
  Just (a, [])    -> Right a
  Just (_, (_:_)) -> Left . errorString $ "Not the end of token stream."
  Nothing         -> Left . errorString $ "parse error"
runAsParser parser s = case runParser parser s of
  Just (a, [])    -> Right a
  Just (_, (_:_)) -> Left . errorString $ "Not the end of token stream."
  Nothing         -> Left . errorString $ "parse error"