Tritlo / PropR

Genetic program repair using GHC
MIT License
30 stars 2 forks source link

ParseError on '=' #103

Closed Tritlo closed 3 years ago

Tritlo commented 3 years ago

It seems this is caused by a weird readExpr definition:

readExpr :: String -> Maybe Expr
readExpr str = do
  let str' = filter (not . isSpace) str
   in case parse expr str' of
        Just (n, "") -> Just n
        _ -> Nothing

this becomes

       readExpr str
         = do let str' = filter (not . isSpace) str
              in
                case parse expr str' of
                  Just (n, "") -> Just n
                  _ -> Nothing

in the fake trace after we've got the counter-examples, which fails with a parseError

this parses however:

       readExpr str
         = do let str' = filter (not . isSpace) str
               in case parse expr str' of
                    Just (n, "") -> Just n
                    _ -> Nothing

I'm not sure this is on us... seems more like an issue with mixing let and do and the layout not being properly preserved.